{
  "openapi": "3.1.0",
  "info": {
    "title": "AdamRMS API",
    "version": "1.0.0",
    "description": "Every action available in an organisation, generated from the same function definitions the AdamRMS interface uses. Reads accept GET with a query string or POST with a JSON body; everything else is POST. Each operation's `x-adamrms-permission` is the permission the caller needs. Send an `Idempotency-Key` header with any change to retry it safely, and add `?dryRun=true` to try one without making it. Each user can make 60 requests every 60 seconds; a 429 response says how long to wait in Retry-After."
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/api/v1/org/{organisationUUID}/asset-import/check": {
      "get": {
        "operationId": "asset-import.check.get",
        "summary": "Check rows of an asset import",
        "description": "Checks spreadsheet rows before they are imported, without changing anything: for each row, what importing it would do (create an asset, update one, skip it), the asset type, category, manufacturer and location it means, and anything to fix. Also lists the categories, manufacturers and asset types the import would create. Cells are sent as text, as the spreadsheet had them; amounts are in the currency's main unit.",
        "tags": ["asset-import"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.IMPORT",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "rows",
            "in": "query",
            "required": true,
            "schema": {
              "minItems": 1,
              "maxItems": 2000,
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AssetImportRow"
              },
              "description": "The rows to check, up to 2000"
            },
            "description": "The rows to check, up to 2000"
          },
          {
            "name": "firstRowNumber",
            "in": "query",
            "required": false,
            "schema": {
              "default": 1,
              "description": "The spreadsheet row number of the first row, used when an issue points to another row. Defaults to 1",
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "description": "The spreadsheet row number of the first row, used when an issue points to another row. Defaults to 1"
          },
          {
            "name": "createCategories",
            "in": "query",
            "required": false,
            "schema": {
              "default": true,
              "description": "Create categories the rows name that don't exist. Defaults to true",
              "type": "boolean"
            },
            "description": "Create categories the rows name that don't exist. Defaults to true"
          },
          {
            "name": "createManufacturers",
            "in": "query",
            "required": false,
            "schema": {
              "default": true,
              "description": "Create manufacturers the rows name that don't exist. Defaults to true",
              "type": "boolean"
            },
            "description": "Create manufacturers the rows name that don't exist. Defaults to true"
          },
          {
            "name": "createLocations",
            "in": "query",
            "required": false,
            "schema": {
              "default": true,
              "description": "Create locations the rows name that don't exist, with any missing locations above them in a path. Defaults to true",
              "type": "boolean"
            },
            "description": "Create locations the rows name that don't exist, with any missing locations above them in a path. Defaults to true"
          },
          {
            "name": "createAssetTypes",
            "in": "query",
            "required": false,
            "schema": {
              "default": true,
              "description": "Create asset types the rows name that don't exist. Defaults to true",
              "type": "boolean"
            },
            "description": "Create asset types the rows name that don't exist. Defaults to true"
          },
          {
            "name": "existingAssets",
            "in": "query",
            "required": false,
            "schema": {
              "default": "SKIP",
              "description": "What to do with a row whose asset ID is already an asset's: `SKIP` it (the default, so importing the same file again adds nothing twice) or `UPDATE` the asset's location, own rate, value and mass, quantity and custom fields from it",
              "type": "string",
              "enum": ["SKIP", "UPDATE"]
            },
            "description": "What to do with a row whose asset ID is already an asset's: `SKIP` it (the default, so importing the same file again adds nothing twice) or `UPDATE` the asset's location, own rate, value and mass, quantity and custom fields from it"
          },
          {
            "name": "massUnit",
            "in": "query",
            "required": false,
            "schema": {
              "default": "kg",
              "description": "The unit of the mass columns: `g`, `kg`, `t`, `oz` or `lb`. Defaults to kg",
              "type": "string",
              "enum": ["g", "kg", "t", "oz", "lb"]
            },
            "description": "The unit of the mass columns: `g`, `kg`, `t`, `oz` or `lb`. Defaults to kg"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetImportCheckOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "asset-import.check",
        "summary": "Check rows of an asset import",
        "description": "Checks spreadsheet rows before they are imported, without changing anything: for each row, what importing it would do (create an asset, update one, skip it), the asset type, category, manufacturer and location it means, and anything to fix. Also lists the categories, manufacturers and asset types the import would create. Cells are sent as text, as the spreadsheet had them; amounts are in the currency's main unit.",
        "tags": ["asset-import"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.IMPORT",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetImportCheckInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetImportCheckOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-import/run": {
      "post": {
        "operationId": "asset-import.run",
        "summary": "Import assets",
        "description": "Imports spreadsheet rows as assets, as `asset-import.check` describes: it creates the missing categories, manufacturers and asset types first, then creates (or updates) an asset per row. Rows with issues are left out and returned as FAILED; the rest are imported. Each record is made through its own function, so the same rules, permissions and Apps apply as when it is made by hand. Importing a row whose asset ID exists again skips it, so a file can be sent again after a failure.",
        "tags": ["asset-import"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.IMPORT",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetImportRunInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetImportRunOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-categories/list": {
      "get": {
        "operationId": "asset-categories.list.get",
        "summary": "List asset categories",
        "description": "Returns the organisation's asset categories as a tree, paginated by top-level category, with optional name search. Sorted by their arranged position unless another sort is asked for.",
        "tags": ["asset-categories"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_CATEGORIES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return categories whose name contains this text (case-insensitive). Matches are returned with their children; a match whose parent does not match is returned at the top level",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return categories whose name contains this text (case-insensitive). Matches are returned with their children; a match whose parent does not match is returned at the top level"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of top-level categories per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of top-level categories per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "position",
              "description": "Field to sort top-level categories by. Defaults to `position`",
              "type": "string",
              "enum": ["position", "name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort top-level categories by. Defaults to `position`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return soft-deleted categories. Needs permission to view deleted categories",
              "type": "boolean"
            },
            "description": "Also return soft-deleted categories. Needs permission to view deleted categories"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetCategoriesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "asset-categories.list",
        "summary": "List asset categories",
        "description": "Returns the organisation's asset categories as a tree, paginated by top-level category, with optional name search. Sorted by their arranged position unless another sort is asked for.",
        "tags": ["asset-categories"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_CATEGORIES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetCategoriesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetCategoriesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-categories/create": {
      "post": {
        "operationId": "asset-categories.create",
        "summary": "Create an asset category",
        "description": "Creates an asset category, either top-level or nested under a parent (at most 3 levels deep). It is added after its existing siblings.",
        "tags": ["asset-categories"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_CATEGORIES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetCategoriesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetCategory"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ICON_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, MAX_NESTING_EXCEEDED, PARENT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-categories/update": {
      "post": {
        "operationId": "asset-categories.update",
        "summary": "Update an asset category",
        "description": "Changes a category's name, description, icon or parent. Fields that are omitted are left unchanged.",
        "tags": ["asset-categories"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_CATEGORIES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetCategoriesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetCategory"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CIRCULAR_REFERENCE, ICON_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, MAX_NESTING_EXCEEDED, PARENT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-categories/reorder": {
      "post": {
        "operationId": "asset-categories.reorder",
        "summary": "Reorder an asset category",
        "description": "Moves a category to a new position among its siblings and renumbers the siblings to match.",
        "tags": ["asset-categories"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_CATEGORIES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetCategoriesReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetCategory"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-categories/delete": {
      "post": {
        "operationId": "asset-categories.delete",
        "summary": "Delete an asset category",
        "description": "Soft-deletes a category. A category that still has live children is only deleted when `cascade` is set, which deletes the children too.",
        "tags": ["asset-categories"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSET_CATEGORIES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetCategoriesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetCategoriesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: HAS_CHILDREN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/list": {
      "get": {
        "operationId": "attachments.list.get",
        "summary": "List a record's files",
        "description": "Returns every folder, file and link attached to a record, such as a location.",
        "tags": ["attachments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATION_FILES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "recordType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "asset-category",
                "asset",
                "asset-type",
                "client",
                "client-contact",
                "location",
                "maintenance-job",
                "project",
                "manufacturer",
                "training-module",
                "member-certification",
                "payment",
                "wiki-page"
              ],
              "description": "The kind of record the files are attached to, e.g. `location`"
            },
            "description": "The kind of record the files are attached to, e.g. `location`"
          },
          {
            "name": "recordUuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the record the files are attached to"
            },
            "description": "UUID of the record the files are attached to"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachmentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "attachments.list",
        "summary": "List a record's files",
        "description": "Returns every folder, file and link attached to a record, such as a location.",
        "tags": ["attachments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATION_FILES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachmentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/create-folder": {
      "post": {
        "operationId": "attachments.create-folder",
        "summary": "Create a folder for a record's files",
        "description": "Creates a folder among a record's files, at the top level or inside another of its folders.",
        "tags": ["attachments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsCreateFolderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachmentFolder"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FOLDER_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/update-folder": {
      "post": {
        "operationId": "attachments.update-folder",
        "summary": "Rename or move a folder of a record's files",
        "description": "Renames a folder, or moves it into another folder on the same record. Fields that are omitted are left unchanged.",
        "tags": ["attachments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsUpdateFolderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachmentFolder"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CIRCULAR_REFERENCE, FOLDER_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/delete-folder": {
      "post": {
        "operationId": "attachments.delete-folder",
        "summary": "Delete a folder of a record's files",
        "description": "Deletes an empty folder. A folder that still holds files or folders is refused; move or delete them first.",
        "tags": ["attachments"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATION_FILES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsDeleteFolderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachmentsDeleteFolderOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_EMPTY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/start-upload": {
      "post": {
        "operationId": "attachments.start-upload",
        "summary": "Start uploading a file to a record",
        "description": "Checks a file can be added to a record (its size, and the organisation's storage allowance) and returns a private URL to PUT its bytes to. Large files are sent in parts. The file appears on the record once `attachments.finish-upload` is called.",
        "tags": ["attachments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsStartUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachmentsStartUploadOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FILE_TOO_LARGE, FOLDER_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/finish-upload": {
      "post": {
        "operationId": "attachments.finish-upload",
        "summary": "Finish uploading a file to a record",
        "description": "Completes an upload begun with `attachments.start-upload` once its bytes have been sent, and adds the file to the record.",
        "tags": ["attachments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsFinishUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachedFile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND, UPLOAD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FOLDER_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, UPLOAD_INCOMPLETE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/add-link": {
      "post": {
        "operationId": "attachments.add-link",
        "summary": "Add a link to a record's files",
        "description": "Adds a named link to a web page (a shared drive folder, a venue's website, ...) among a record's files.",
        "tags": ["attachments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsAddLinkInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachedFile"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FOLDER_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/update-file": {
      "post": {
        "operationId": "attachments.update-file",
        "summary": "Rename or move a record's file",
        "description": "Renames a file or link attached to a record, or moves it into another of the record's folders or onto another record of the same kind. Fields that are omitted are left unchanged. Files in some categories, such as issued documents, can't be renamed or moved to another record.",
        "tags": ["attachments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsUpdateFileInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachedFile"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_ALLOWED_IN_CATEGORY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FOLDER_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, RECORD_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/attachments/delete-file": {
      "post": {
        "operationId": "attachments.delete-file",
        "summary": "Delete a record's file",
        "description": "Moves a file or link attached to a record to the organisation's trash, where it can be restored until the trash is emptied. Files in some categories, such as issued documents, can't be deleted.",
        "tags": ["attachments"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATION_FILES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsDeleteFileInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AttachmentsDeleteFileOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_ALLOWED_IN_CATEGORY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/locations/list": {
      "get": {
        "operationId": "locations.list.get",
        "summary": "List locations",
        "description": "Returns the organisation's locations (venues, warehouses, shelves, ...) as a tree, paginated by top-level location, with optional search by name or address and filter by client. Archived locations are left out unless asked for.",
        "tags": ["locations"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LOCATIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return locations whose name or address contains this text (case-insensitive). Matches are returned with the locations inside them; a match whose parent does not match is returned at the top level",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return locations whose name or address contains this text (case-insensitive). Matches are returned with the locations inside them; a match whose parent does not match is returned at the top level"
          },
          {
            "name": "clientUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return locations that belong to this client. Like a search, a match whose parent does not match is returned at the top level",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return locations that belong to this client. Like a search, a match whose parent does not match is returned at the top level"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of top-level locations per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of top-level locations per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort top-level locations by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort top-level locations by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return archived locations",
              "type": "boolean"
            },
            "description": "Also return archived locations"
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return soft-deleted locations. Needs permission to view deleted locations",
              "type": "boolean"
            },
            "description": "Also return soft-deleted locations. Needs permission to view deleted locations"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "locations.list",
        "summary": "List locations",
        "description": "Returns the organisation's locations (venues, warehouses, shelves, ...) as a tree, paginated by top-level location, with optional search by name or address and filter by client. Archived locations are left out unless asked for.",
        "tags": ["locations"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LOCATIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/locations/get": {
      "get": {
        "operationId": "locations.get.get",
        "summary": "Get a location",
        "description": "Returns one location, archived or not, with the chain of locations it is inside.",
        "tags": ["locations"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LOCATIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the location"
            },
            "description": "UUID of the location"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "locations.get",
        "summary": "Get a location",
        "description": "Returns one location, archived or not, with the chain of locations it is inside.",
        "tags": ["locations"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LOCATIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/locations/create": {
      "post": {
        "operationId": "locations.create",
        "summary": "Create a location",
        "description": "Creates a location, either top-level or inside another location, optionally belonging to a client. Locations nest to any depth.",
        "tags": ["locations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "LOCATIONS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, PARENT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/locations/update": {
      "post": {
        "operationId": "locations.update",
        "summary": "Update a location",
        "description": "Changes a location's name, address, notes, parent or client. Fields that are omitted are left unchanged.",
        "tags": ["locations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "LOCATIONS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CIRCULAR_REFERENCE, CLIENT_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, PARENT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/locations/set-archived": {
      "post": {
        "operationId": "locations.set-archived",
        "summary": "Archive or unarchive a location",
        "description": "Archives a location that is no longer used, hiding it from lists without deleting it, or brings an archived location back into use. Locations inside it are not changed.",
        "tags": ["locations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "LOCATIONS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationsSetArchivedInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/locations/delete": {
      "post": {
        "operationId": "locations.delete",
        "summary": "Delete a location",
        "description": "Soft-deletes a location. A location that still has live locations inside it is only deleted when `cascade` is set, which deletes them too.",
        "tags": ["locations"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "LOCATIONS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: HAS_CHILDREN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/list": {
      "get": {
        "operationId": "clients.list.get",
        "summary": "List clients",
        "description": "Returns the organisation's clients, sorted and paged, with optional search by name (or by the name, email or phone of a contact there) and an optional filter to the clients under one client (or the top level). Archived clients are left out unless asked for.",
        "tags": ["clients"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return clients whose name contains this text, or with a contact whose name, email or phone number contains it (case-insensitive), at any level of nesting",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return clients whose name contains this text, or with a contact whose name, email or phone number contains it (case-insensitive), at any level of nesting"
          },
          {
            "name": "parentUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return clients directly under this client, or only top-level clients if null. Omit to return clients at every level",
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only return clients directly under this client, or only top-level clients if null. Omit to return clients at every level"
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return archived clients",
              "type": "boolean"
            },
            "description": "Also return archived clients"
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return soft-deleted clients. Needs permission to view deleted clients",
              "type": "boolean"
            },
            "description": "Also return soft-deleted clients. Needs permission to view deleted clients"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of clients per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of clients per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort clients by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort clients by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "clients.list",
        "summary": "List clients",
        "description": "Returns the organisation's clients, sorted and paged, with optional search by name (or by the name, email or phone of a contact there) and an optional filter to the clients under one client (or the top level). Archived clients are left out unless asked for.",
        "tags": ["clients"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/get": {
      "get": {
        "operationId": "clients.get.get",
        "summary": "Get a client",
        "description": "Returns one client, including an archived one, with the clients it sits under.",
        "tags": ["clients"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the client"
            },
            "description": "UUID of the client"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "clients.get",
        "summary": "Get a client",
        "description": "Returns one client, including an archived one, with the clients it sits under.",
        "tags": ["clients"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/timeline": {
      "get": {
        "operationId": "clients.timeline.get",
        "summary": "Read a client's timeline",
        "description": "Returns what has happened with a client, newest first: projects made for them, quotes issued, accepted or declined, invoices and credit notes issued, payments and refunds, documents emailed to them, and comments on the client. Quotes, invoices and payments cover the client's projects and their sub-projects. Entries the caller can't see, such as payments without access to payments, are left out.",
        "tags": ["clients"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the client"
            },
            "description": "UUID of the client"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "nextCursor from the previous page, to read further back. Leave out for the newest",
              "type": "string",
              "maxLength": 200
            },
            "description": "nextCursor from the previous page, to read further back. Leave out for the newest"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 30,
              "description": "How many entries to return, up to 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "How many entries to return, up to 100"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientsTimelineOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "clients.timeline",
        "summary": "Read a client's timeline",
        "description": "Returns what has happened with a client, newest first: projects made for them, quotes issued, accepted or declined, invoices and credit notes issued, payments and refunds, documents emailed to them, and comments on the client. Quotes, invoices and payments cover the client's projects and their sub-projects. Entries the caller can't see, such as payments without access to payments, are left out.",
        "tags": ["clients"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsTimelineInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientsTimelineOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/create": {
      "post": {
        "operationId": "clients.create",
        "summary": "Create a client",
        "description": "Creates a client: a business or person the organisation hires to, either top-level or under another client (at most three levels deep). Only the name is required.",
        "tags": ["clients"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENTS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Client"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, MAX_NESTING_EXCEEDED, PARENT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/update": {
      "post": {
        "operationId": "clients.update",
        "summary": "Update a client",
        "description": "Changes a client's details or moves it under another client. Fields that are omitted are left unchanged; null clears a field.",
        "tags": ["clients"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Client"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CIRCULAR_REFERENCE, IDEMPOTENCY_KEY_REUSED, MAX_NESTING_EXCEEDED, PARENT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/archive": {
      "post": {
        "operationId": "clients.archive",
        "summary": "Archive a client",
        "description": "Archives a client, so it stays on record but can't be picked for new work. Archiving an archived client changes nothing.",
        "tags": ["clients"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsArchiveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Client"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/unarchive": {
      "post": {
        "operationId": "clients.unarchive",
        "summary": "Unarchive a client",
        "description": "Makes an archived client active again. Unarchiving an active client changes nothing.",
        "tags": ["clients"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsUnarchiveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Client"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/delete": {
      "post": {
        "operationId": "clients.delete",
        "summary": "Delete a client",
        "description": "Soft-deletes a client. A client that still has live sub-clients is only deleted when `cascade` is set, which deletes them too. To keep a client on record but out of the way, archive it instead.",
        "tags": ["clients"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "CLIENTS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: HAS_CHILDREN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-contacts/list": {
      "get": {
        "operationId": "client-contacts.list.get",
        "summary": "List a client's contacts",
        "description": "Returns the people at a client, with their job titles, email addresses and phone numbers, sorted and paged.",
        "tags": ["client-contacts"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "clientUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the client whose contacts to list"
            },
            "description": "UUID of the client whose contacts to list"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of contacts per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of contacts per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort contacts by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort contacts by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientContactsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "client-contacts.list",
        "summary": "List a client's contacts",
        "description": "Returns the people at a client, with their job titles, email addresses and phone numbers, sorted and paged.",
        "tags": ["client-contacts"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientContactsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientContactsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-contacts/get": {
      "get": {
        "operationId": "client-contacts.get.get",
        "summary": "Get a client contact",
        "description": "Returns one person at a client, including which client.",
        "tags": ["client-contacts"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the contact"
            },
            "description": "UUID of the contact"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientContact"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "client-contacts.get",
        "summary": "Get a client contact",
        "description": "Returns one person at a client, including which client.",
        "tags": ["client-contacts"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientContactsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientContact"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-contacts/create": {
      "post": {
        "operationId": "client-contacts.create",
        "summary": "Add a contact to a client",
        "description": "Adds a person at a client. Only the name is required.",
        "tags": ["client-contacts"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientContactsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientContact"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-contacts/update": {
      "post": {
        "operationId": "client-contacts.update",
        "summary": "Update a client contact",
        "description": "Changes a contact's details. Fields that are omitted are left unchanged; null clears a field.",
        "tags": ["client-contacts"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientContactsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientContact"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-contacts/delete": {
      "post": {
        "operationId": "client-contacts.delete",
        "summary": "Remove a client contact",
        "description": "Soft-deletes a contact from its client.",
        "tags": ["client-contacts"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "CLIENTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientContactsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientContactsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/manufacturers/list": {
      "get": {
        "operationId": "manufacturers.list.get",
        "summary": "List manufacturers",
        "description": "Returns the organisation's asset manufacturers as a tree of parent companies and the manufacturers they own, paginated by top-level manufacturer, with optional name search.",
        "tags": ["manufacturers"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MANUFACTURERS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return manufacturers whose name contains this text (case-insensitive). Matches are returned with the manufacturers they own; a match whose parent does not match is returned at the top level",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return manufacturers whose name contains this text (case-insensitive). Matches are returned with the manufacturers they own; a match whose parent does not match is returned at the top level"
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return soft-deleted manufacturers. Needs permission to view deleted manufacturers",
              "type": "boolean"
            },
            "description": "Also return soft-deleted manufacturers. Needs permission to view deleted manufacturers"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of manufacturers per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of manufacturers per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort manufacturers by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort manufacturers by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ManufacturersListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "manufacturers.list",
        "summary": "List manufacturers",
        "description": "Returns the organisation's asset manufacturers as a tree of parent companies and the manufacturers they own, paginated by top-level manufacturer, with optional name search.",
        "tags": ["manufacturers"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MANUFACTURERS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManufacturersListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ManufacturersListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/manufacturers/create": {
      "post": {
        "operationId": "manufacturers.create",
        "summary": "Create a manufacturer",
        "description": "Creates a manufacturer, either top-level or owned by a parent company. A name already used by another live manufacturer (ignoring case) is refused.",
        "tags": ["manufacturers"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MANUFACTURERS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManufacturersCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Manufacturer"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, PARENT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/manufacturers/update": {
      "post": {
        "operationId": "manufacturers.update",
        "summary": "Update a manufacturer",
        "description": "Changes a manufacturer's name, website, notes or parent company. Fields that are omitted are left unchanged.",
        "tags": ["manufacturers"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MANUFACTURERS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManufacturersUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Manufacturer"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CIRCULAR_REFERENCE, IDEMPOTENCY_KEY_REUSED, PARENT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/manufacturers/delete": {
      "post": {
        "operationId": "manufacturers.delete",
        "summary": "Delete a manufacturer",
        "description": "Soft-deletes a manufacturer. Manufacturers it owned are not deleted; they become top-level.",
        "tags": ["manufacturers"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "MANUFACTURERS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManufacturersDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ManufacturersDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/list": {
      "get": {
        "operationId": "asset-types.list.get",
        "summary": "List asset types",
        "description": "Returns the organisation's asset types (its catalogue: what it hires out), paginated, with optional search and category or manufacturer filters.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return types whose name, manufacturer or category contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return types whose name, manufacturer or category contains this text (case-insensitive)"
          },
          {
            "name": "categoryUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return types in this category or its subcategories",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return types in this category or its subcategories"
          },
          {
            "name": "manufacturerUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return types made by this manufacturer",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return types made by this manufacturer"
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return soft-deleted types. Needs permission to view deleted asset types",
              "type": "boolean"
            },
            "description": "Also return soft-deleted types. Needs permission to view deleted asset types"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of asset types per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of asset types per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort asset types by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort asset types by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetTypesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "asset-types.list",
        "summary": "List asset types",
        "description": "Returns the organisation's asset types (its catalogue: what it hires out), paginated, with optional search and category or manufacturer filters.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetTypesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/set-tracking": {
      "post": {
        "operationId": "asset-types.set-tracking",
        "summary": "Change how an asset type is tracked",
        "description": "Changes an asset type between individually tracked and bulk, converting its assets. To BULK: units that are alike (same storage location, case, overrides and custom field values) merge into one lot, which keeps all their asset IDs. To INDIVIDUAL: each lot of N becomes N units; the lot keeps its IDs and the new units take IDs from the organisation's sequence, and empty lots are deleted. Assets on open maintenance jobs or on projects that haven't finished or been lost stop it. Call with `preview` first to see what would happen and what stops it.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSET_TYPES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesSetTrackingInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetTypesSetTrackingOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, TRACKING_CHANGE_BLOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/get": {
      "get": {
        "operationId": "asset-types.get.get",
        "summary": "Get an asset type",
        "description": "Returns one asset type, including its custom field values, rate, price structure, mass and value.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the asset type"
            },
            "description": "UUID of the asset type"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetType"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "asset-types.get",
        "summary": "Get an asset type",
        "description": "Returns one asset type, including its custom field values, rate, price structure, mass and value.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetType"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/create": {
      "post": {
        "operationId": "asset-types.create",
        "summary": "Create an asset type",
        "description": "Creates an asset type in a category (one with no subcategories), optionally with a thumbnail, manufacturer, rate, price structure, mass, replacement value and custom field values. Whether its stock is tracked as individual units or in bulk lots is chosen here.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_TYPES.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetType"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, TRACKING_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CATEGORY_HAS_SUBCATEGORIES, CATEGORY_NOT_FOUND, CONSUMABLE_MUST_BE_BULK, IDEMPOTENCY_KEY_REUSED, INVALID_CUSTOM_FIELDS, INVALID_THUMBNAIL, MANUFACTURER_NOT_FOUND, MASS_UNIT_REQUIRED, PRICE_STRUCTURE_NOT_FOUND, REJECTED_BY_APP, TAX_RATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/update": {
      "post": {
        "operationId": "asset-types.update",
        "summary": "Update an asset type",
        "description": "Changes an asset type. Fields that are omitted are left unchanged. Changing the rate or price structure never changes prices already agreed on bookings.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_TYPES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetType"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, TRACKING_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CATEGORY_HAS_SUBCATEGORIES, CATEGORY_NOT_FOUND, CONSUMABLE_MUST_BE_BULK, IDEMPOTENCY_KEY_REUSED, INVALID_CUSTOM_FIELDS, INVALID_THUMBNAIL, MANUFACTURER_NOT_FOUND, MASS_UNIT_REQUIRED, PRICE_STRUCTURE_NOT_FOUND, REJECTED_BY_APP, TAX_RATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/delete": {
      "post": {
        "operationId": "asset-types.delete",
        "summary": "Delete an asset type",
        "description": "Soft-deletes an asset type. A type that still has assets can't be deleted: delete its assets first.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSET_TYPES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetTypesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: HAS_ASSETS, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/add-thumbnail": {
      "post": {
        "operationId": "asset-types.add-thumbnail",
        "summary": "Add a thumbnail to an asset type",
        "description": "Adds a thumbnail to an asset type, last or as its main thumbnail. A type can have up to 10 thumbnails. The main one is shown wherever the type is.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_TYPES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesAddThumbnailInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetTypesAddThumbnailOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, TOO_MANY_THUMBNAILS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_THUMBNAIL, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/remove-thumbnail": {
      "post": {
        "operationId": "asset-types.remove-thumbnail",
        "summary": "Remove a thumbnail from an asset type",
        "description": "Removes one of an asset type's thumbnails for good. Removing the main thumbnail makes the next one the main thumbnail.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSET_TYPES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesRemoveThumbnailInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetType"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-types/set-main-thumbnail": {
      "post": {
        "operationId": "asset-types.set-main-thumbnail",
        "summary": "Choose an asset type's main thumbnail",
        "description": "Makes one of an asset type's thumbnails its main thumbnail, shown wherever the type is. The old main thumbnail takes its place among the others.",
        "tags": ["asset-types"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_TYPES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetTypesSetMainThumbnailInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetType"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/accessories/get": {
      "get": {
        "operationId": "accessories.get.get",
        "summary": "Get an asset type's accessories",
        "description": "Returns the accessories of an asset type (the other asset types that go out with it, how many, and whether each can be left out), and the asset types it is itself an accessory of.",
        "tags": ["accessories"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetTypeUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the asset type"
            },
            "description": "UUID of the asset type"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Accessories"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "accessories.get",
        "summary": "Get an asset type's accessories",
        "description": "Returns the accessories of an asset type (the other asset types that go out with it, how many, and whether each can be left out), and the asset types it is itself an accessory of.",
        "tags": ["accessories"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessoriesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Accessories"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/accessories/set": {
      "post": {
        "operationId": "accessories.set",
        "summary": "Set an asset type's accessories",
        "description": "Replaces the accessories of an asset type with the list given, such as the clamp and safety bond that go out with a lantern. An empty list removes them all.",
        "tags": ["accessories"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_TYPES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessoriesSetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Accessories"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ACCESSORY_NOT_FOUND, CIRCULAR_REFERENCE, DUPLICATE_ACCESSORY, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_DEEP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/packages/list": {
      "get": {
        "operationId": "packages.list.get",
        "summary": "List packages",
        "description": "Returns packages: bundles of asset types hired out together at one price. Filter by name, or to the packages one asset type is in. Call packages.get for what is in a package.",
        "tags": ["packages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PACKAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return packages whose name contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return packages whose name contains this text (case-insensitive)"
          },
          {
            "name": "assetTypeUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return the packages this asset type is in",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return the packages this asset type is in"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of packages per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of packages per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort packages by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort packages by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PackagesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "packages.list",
        "summary": "List packages",
        "description": "Returns packages: bundles of asset types hired out together at one price. Filter by name, or to the packages one asset type is in. Call packages.get for what is in a package.",
        "tags": ["packages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PACKAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackagesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PackagesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/packages/get": {
      "get": {
        "operationId": "packages.get.get",
        "summary": "Get a package",
        "description": "Returns one package with its rate and the asset types in it, how many of each, and whether each can be left out.",
        "tags": ["packages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PACKAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the package"
            },
            "description": "UUID of the package"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Package"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "packages.get",
        "summary": "Get a package",
        "description": "Returns one package with its rate and the asset types in it, how many of each, and whether each can be left out.",
        "tags": ["packages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PACKAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackagesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Package"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/packages/create": {
      "post": {
        "operationId": "packages.create",
        "summary": "Create a package",
        "description": "Creates a package: a bundle of asset types hired out together at one rate, such as a small PA package of two speakers, two stands and a desk. It has no stock of its own.",
        "tags": ["packages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PACKAGES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackagesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Package"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_TYPE_NOT_FOUND, DUPLICATE_ASSET_TYPE, IDEMPOTENCY_KEY_REUSED, PRICE_STRUCTURE_NOT_FOUND, REJECTED_BY_APP, TAX_RATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/packages/update": {
      "post": {
        "operationId": "packages.update",
        "summary": "Update a package",
        "description": "Changes a package's name, description, rate or price structure, or replaces the asset types in it. Fields that are omitted are left unchanged.",
        "tags": ["packages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PACKAGES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackagesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Package"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_TYPE_NOT_FOUND, DUPLICATE_ASSET_TYPE, IDEMPOTENCY_KEY_REUSED, PRICE_STRUCTURE_NOT_FOUND, REJECTED_BY_APP, TAX_RATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/packages/delete": {
      "post": {
        "operationId": "packages.delete",
        "summary": "Delete a package",
        "description": "Soft-deletes a package. The asset types in it, and their assets, are not changed.",
        "tags": ["packages"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PACKAGES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackagesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PackagesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/calendar/projects": {
      "get": {
        "operationId": "calendar.projects.get",
        "summary": "List the projects on the calendar",
        "description": "Returns the projects whose event dates (or out dates, if they have no event dates) fall in a period, earliest first: the organisation's calendar. Lost and deleted projects aren't on it. Sub-projects with dates of their own are only listed if the calendar settings say so. Filter to the projects with an asset type on them, an asset allocated to them, or at one location; a filter also lists the sub-projects it matches.",
        "tags": ["calendar"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
            },
            "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
            },
            "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
          },
          {
            "name": "assetTypeUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects with this asset type on them",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only projects with this asset type on them"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects this asset is allocated to",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only projects this asset is allocated to"
          },
          {
            "name": "venueUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects at this location",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only projects at this location"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarProjectsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "calendar.projects",
        "summary": "List the projects on the calendar",
        "description": "Returns the projects whose event dates (or out dates, if they have no event dates) fall in a period, earliest first: the organisation's calendar. Lost and deleted projects aren't on it. Sub-projects with dates of their own are only listed if the calendar settings say so. Filter to the projects with an asset type on them, an asset allocated to them, or at one location; a filter also lists the sub-projects it matches.",
        "tags": ["calendar"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarProjectsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarProjectsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/calendar/mine": {
      "get": {
        "operationId": "calendar.mine.get",
        "summary": "List the caller's own calendar",
        "description": "Returns the caller's own projects in a period, earliest first: those they manage or follow, with their sub-projects' dates where they have their own. Lost and deleted projects aren't on it.",
        "tags": ["calendar"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CALENDAR.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
            },
            "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
            },
            "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarMineOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "calendar.mine",
        "summary": "List the caller's own calendar",
        "description": "Returns the caller's own projects in a period, earliest first: those they manage or follow, with their sub-projects' dates where they have their own. Lost and deleted projects aren't on it.",
        "tags": ["calendar"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CALENDAR.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarMineInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarMineOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/calendar/member": {
      "get": {
        "operationId": "calendar.member.get",
        "summary": "List a member's calendar",
        "description": "Returns the projects a member manages or is on the crew of in a period, earliest first, as on their profile. Projects they only follow aren't included. Lost and deleted projects aren't on it.",
        "tags": ["calendar"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
            },
            "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
            },
            "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
          },
          {
            "name": "memberUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the member whose calendar to list"
            },
            "description": "UUID of the member whose calendar to list"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarMemberOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "calendar.member",
        "summary": "List a member's calendar",
        "description": "Returns the projects a member manages or is on the crew of in a period, earliest first, as on their profile. Projects they only follow aren't included. Lost and deleted projects aren't on it.",
        "tags": ["calendar"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarMemberInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarMemberOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/calendar-settings/get": {
      "get": {
        "operationId": "calendar-settings.get.get",
        "summary": "Get calendar settings",
        "description": "Returns how the organisation's calendar looks: whether statuses and sub-projects show, the view it opens in, and its week labels.",
        "tags": ["calendar-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CALENDAR.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarSettingsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "calendar-settings.get",
        "summary": "Get calendar settings",
        "description": "Returns how the organisation's calendar looks: whether statuses and sub-projects show, the view it opens in, and its week labels.",
        "tags": ["calendar-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CALENDAR.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarSettingsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarSettingsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/calendar-settings/update": {
      "post": {
        "operationId": "calendar-settings.update",
        "summary": "Update calendar settings",
        "description": "Changes how the organisation's calendar looks. Week labels are replaced as a whole: send every label to keep.",
        "tags": ["calendar-settings"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarSettings"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/calendar-feeds/get": {
      "get": {
        "operationId": "calendar-feeds.get.get",
        "summary": "Get the caller's calendar feed",
        "description": "Returns the caller's private calendar feed, if they have made one: what it holds and when it was last fetched. Its address is only shown when it's made.",
        "tags": ["calendar-feeds"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CALENDAR.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarFeedsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "calendar-feeds.get",
        "summary": "Get the caller's calendar feed",
        "description": "Returns the caller's private calendar feed, if they have made one: what it holds and when it was last fetched. Its address is only shown when it's made.",
        "tags": ["calendar-feeds"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CALENDAR.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarFeedsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarFeedsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/calendar-feeds/create": {
      "post": {
        "operationId": "calendar-feeds.create",
        "summary": "Create the caller's calendar feed",
        "description": "Creates a private address the caller's calendar app (Google, Apple or Outlook) can subscribe to, holding their own projects or every project on the organisation's calendar. It replaces any feed they had, whose address stops working. The address is only returned now.",
        "tags": ["calendar-feeds"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CALENDAR.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarFeedsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarFeedsCreateOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/calendar-feeds/revoke": {
      "post": {
        "operationId": "calendar-feeds.revoke",
        "summary": "Revoke the caller's calendar feed",
        "description": "Stops the caller's calendar feed working. Calendar apps subscribed to it stop getting updates.",
        "tags": ["calendar-feeds"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CALENDAR.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarFeedsRevokeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarFeedsRevokeOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/dashboard/get": {
      "get": {
        "operationId": "dashboard.get.get",
        "summary": "Get the caller's dashboard",
        "description": "Returns the widgets on the caller's dashboard and what they hold: their own projects over the next two weeks, projects going out and coming back today, projects short of stock over the next 30 days, their maintenance jobs, open maintenance jobs, inspections overdue or due in the next two weeks, the inventory's value and mass, its value over the last year, the number of members and file storage used. Each widget is only there for callers who can see what it shows, and is null if they've hidden it.",
        "tags": ["dashboard"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DASHBOARD.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Dashboard"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "dashboard.get",
        "summary": "Get the caller's dashboard",
        "description": "Returns the widgets on the caller's dashboard and what they hold: their own projects over the next two weeks, projects going out and coming back today, projects short of stock over the next 30 days, their maintenance jobs, open maintenance jobs, inspections overdue or due in the next two weeks, the inventory's value and mass, its value over the last year, the number of members and file storage used. Each widget is only there for callers who can see what it shows, and is null if they've hidden it.",
        "tags": ["dashboard"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DASHBOARD.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Dashboard"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/dashboard/set-widgets": {
      "post": {
        "operationId": "dashboard.set-widgets",
        "summary": "Choose the caller's dashboard widgets",
        "description": "Sets which widgets the caller hides from their dashboard. Every other widget they can see is shown, including ones added to AdamRMS later. It only changes the caller's own dashboard.",
        "tags": ["dashboard"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "DASHBOARD.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardSetWidgetsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DashboardSetWidgetsOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/list": {
      "get": {
        "operationId": "wiki-pages.list.get",
        "summary": "List wiki pages",
        "description": "Returns the organisation's wiki pages that the caller can see, without their content. Filter by text, to the sub-pages of one page, to top-level pages, or to the pages in the side menu. A page limited to some roles is only seen by their members and by those who can edit pages; to anyone else it is not found. Call wiki-pages.get for a page's content.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return pages whose name or description contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return pages whose name or description contains this text (case-insensitive)"
          },
          {
            "name": "parentUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return the sub-pages of this page. Null for top-level pages only. Omit for pages at every level",
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only return the sub-pages of this page. Null for top-level pages only. Omit for pages at every level"
          },
          {
            "name": "inMenu",
            "in": "query",
            "required": false,
            "schema": {
              "description": "True for only the pages listed in the side menu",
              "type": "boolean"
            },
            "description": "True for only the pages listed in the side menu"
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "schema": {
              "default": "LIVE",
              "description": "`LIVE` (the default) for pages that aren't archived, `ARCHIVED` for archived pages only, `ALL` for both",
              "type": "string",
              "enum": ["LIVE", "ARCHIVED", "ALL"]
            },
            "description": "`LIVE` (the default) for pages that aren't archived, `ARCHIVED` for archived pages only, `ALL` for both"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of pages per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of pages per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "menuOrder",
              "description": "Field to sort pages by. Defaults to `menuOrder`",
              "type": "string",
              "enum": ["name", "menuOrder", "createdAt", "updatedAt"]
            },
            "description": "Field to sort pages by. Defaults to `menuOrder`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "wiki-pages.list",
        "summary": "List wiki pages",
        "description": "Returns the organisation's wiki pages that the caller can see, without their content. Filter by text, to the sub-pages of one page, to top-level pages, or to the pages in the side menu. A page limited to some roles is only seen by their members and by those who can edit pages; to anyone else it is not found. Call wiki-pages.get for a page's content.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/get": {
      "get": {
        "operationId": "wiki-pages.get.get",
        "summary": "Get a wiki page",
        "description": "Returns one wiki page with its content: the newest revision, or an earlier one by number. A page limited to some roles is only seen by their members and by those who can edit pages; to anyone else it is not found.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the page"
            },
            "description": "UUID of the page"
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Number of an earlier revision to return. Omit for the newest",
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "description": "Number of an earlier revision to return. Omit for the newest"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPageWithContent"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, REVISION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "wiki-pages.get",
        "summary": "Get a wiki page",
        "description": "Returns one wiki page with its content: the newest revision, or an earlier one by number. A page limited to some roles is only seen by their members and by those who can edit pages; to anyone else it is not found.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPageWithContent"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, REVISION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/create": {
      "post": {
        "operationId": "wiki-pages.create",
        "summary": "Create a wiki page",
        "description": "Creates a wiki page with its first content, as revision 1. A page's content is a list of cards, each with Markdown text.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WIKI_PAGES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPageWithContent"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, PARENT_NOT_FOUND, REJECTED_BY_APP, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/update": {
      "post": {
        "operationId": "wiki-pages.update",
        "summary": "Update a wiki page's details",
        "description": "Changes a wiki page's title, description, icon, parent page, place in the side menu, which roles can see it, or whether it is archived. Fields that are omitted are left unchanged. To change its content, call wiki-pages.save.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WIKI_PAGES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPage"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CIRCULAR_REFERENCE, IDEMPOTENCY_KEY_REUSED, PARENT_NOT_FOUND, REJECTED_BY_APP, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/move": {
      "post": {
        "operationId": "wiki-pages.move",
        "summary": "Move a wiki page up or down",
        "description": "Moves a wiki page one place up or down among its sibling pages, which sets its place in the side menu and in lists. New pages go to the end. Archived pages only move among archived pages.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WIKI_PAGES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesMoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPage"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/save": {
      "post": {
        "operationId": "wiki-pages.save",
        "summary": "Save a wiki page's content",
        "description": "Replaces a wiki page's cards, as a new revision. Earlier revisions are kept, and can be brought back with wiki-pages.restore-revision. Pass `baseRevision` to refuse the save if someone else has saved since.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WIKI_PAGES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesSaveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPageWithContent"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: CONFLICT, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/list-revisions": {
      "get": {
        "operationId": "wiki-pages.list-revisions.get",
        "summary": "List a wiki page's revisions",
        "description": "Returns the saved versions of a wiki page, newest first by default, with who saved each and their note. Call wiki-pages.get with a revision number for its content.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the page"
            },
            "description": "UUID of the page"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of revisions per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of revisions per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "revision",
              "description": "Field to sort revisions by. Defaults to `revision`",
              "type": "string",
              "enum": ["revision"]
            },
            "description": "Field to sort revisions by. Defaults to `revision`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesListRevisionsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "wiki-pages.list-revisions",
        "summary": "List a wiki page's revisions",
        "description": "Returns the saved versions of a wiki page, newest first by default, with who saved each and their note. Call wiki-pages.get with a revision number for its content.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesListRevisionsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesListRevisionsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/restore-revision": {
      "post": {
        "operationId": "wiki-pages.restore-revision",
        "summary": "Restore an earlier revision of a wiki page",
        "description": "Brings back the content of an earlier revision, by saving it again as a new revision. Nothing is lost: the revisions in between are kept.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WIKI_PAGES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesRestoreRevisionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPageWithContent"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, REVISION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/delete": {
      "post": {
        "operationId": "wiki-pages.delete",
        "summary": "Delete a wiki page",
        "description": "Soft-deletes a wiki page. A page with sub-pages is refused until they are moved or deleted. A role that showed the page in place of its dashboard goes back to the usual dashboard.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "WIKI_PAGES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: HAS_SUB_PAGES, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/record-view": {
      "post": {
        "operationId": "wiki-pages.record-view",
        "summary": "Record a view of a wiki page",
        "description": "Records that the caller opened a wiki page, for its view counts. Call it once each time a person opens the page, not when software reads it. Views are kept for 12 months.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesRecordViewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesRecordViewOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/view-stats": {
      "get": {
        "operationId": "wiki-pages.view-stats.get",
        "summary": "Count a wiki page's views",
        "description": "Returns how often a wiki page was viewed over the last days, and by how many members: in total, per day and by where it was viewed. Views are kept for 12 months.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW_STATS",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the page"
            },
            "description": "UUID of the page"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "default": 30,
              "description": "How many days to count back from today, at most 365. Defaults to 30",
              "type": "integer",
              "minimum": 1,
              "maximum": 365
            },
            "description": "How many days to count back from today, at most 365. Defaults to 30"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesViewStatsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "wiki-pages.view-stats",
        "summary": "Count a wiki page's views",
        "description": "Returns how often a wiki page was viewed over the last days, and by how many members: in total, per day and by where it was viewed. Views are kept for 12 months.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW_STATS",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesViewStatsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesViewStatsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/list-views": {
      "get": {
        "operationId": "wiki-pages.list-views.get",
        "summary": "List a wiki page's views",
        "description": "Returns who viewed a wiki page and when, newest first by default. Views are kept for 12 months.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW_STATS",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the page"
            },
            "description": "UUID of the page"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of views per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of views per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "viewedAt",
              "description": "Field to sort views by. Defaults to `viewedAt`",
              "type": "string",
              "enum": ["viewedAt"]
            },
            "description": "Field to sort views by. Defaults to `viewedAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesListViewsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "wiki-pages.list-views",
        "summary": "List a wiki page's views",
        "description": "Returns who viewed a wiki page and when, newest first by default. Views are kept for 12 months.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW_STATS",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesListViewsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesListViewsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/list-dashboards": {
      "get": {
        "operationId": "wiki-pages.list-dashboards.get",
        "summary": "List each role's dashboard",
        "description": "Returns every role in the organisation, with the wiki page its members see in place of the dashboard, if one is set.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesListDashboardsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "wiki-pages.list-dashboards",
        "summary": "List each role's dashboard",
        "description": "Returns every role in the organisation, with the wiki page its members see in place of the dashboard, if one is set.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesListDashboardsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesListDashboardsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/set-dashboard": {
      "post": {
        "operationId": "wiki-pages.set-dashboard",
        "summary": "Choose a role's dashboard",
        "description": "Shows a wiki page to a role's members in place of the dashboard, or with null goes back to the usual dashboard. The page must be visible to the role.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WIKI_PAGES.SET_DASHBOARDS",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesSetDashboardInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesSetDashboardOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, NOT_VISIBLE, PAGE_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/wiki-pages/get-dashboard": {
      "get": {
        "operationId": "wiki-pages.get-dashboard.get",
        "summary": "Get the caller's dashboard page",
        "description": "Returns the wiki page the caller's role shows in place of the dashboard, with its content, or null if the role has the usual dashboard.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesGetDashboardOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "wiki-pages.get-dashboard",
        "summary": "Get the caller's dashboard page",
        "description": "Returns the wiki page the caller's role shows in place of the dashboard, with its content, or null if the role has the usual dashboard.",
        "tags": ["wiki-pages"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WIKI_PAGES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WikiPagesGetDashboardInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WikiPagesGetDashboardOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/list": {
      "get": {
        "operationId": "asset-groups.list.get",
        "summary": "List asset groups",
        "description": "Returns the asset groups the caller can see: the organisation's shared groups and the caller's own personal groups, with how many assets each holds. Filter by name, or to the groups one asset is in. To list a group's assets, call assets.list with its groupUUID.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_GROUPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return groups whose name contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return groups whose name contains this text (case-insensitive)"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return the groups this asset is in",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return the groups this asset is in"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of asset groups per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of asset groups per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort asset groups by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort asset groups by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroupsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "asset-groups.list",
        "summary": "List asset groups",
        "description": "Returns the asset groups the caller can see: the organisation's shared groups and the caller's own personal groups, with how many assets each holds. Filter by name, or to the groups one asset is in. To list a group's assets, call assets.list with its groupUUID.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_GROUPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroupsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/get": {
      "get": {
        "operationId": "asset-groups.get.get",
        "summary": "Get an asset group",
        "description": "Returns one asset group. Another member's personal group is reported as not found.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_GROUPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the asset group"
            },
            "description": "UUID of the asset group"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroup"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "asset-groups.get",
        "summary": "Get an asset group",
        "description": "Returns one asset group. Another member's personal group is reported as not found.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_GROUPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroup"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/create": {
      "post": {
        "operationId": "asset-groups.create",
        "summary": "Create an asset group",
        "description": "Creates an empty asset group, shared with the organisation or personal to the caller. Add assets to it with asset-groups.add-assets.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_GROUPS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroup"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/update": {
      "post": {
        "operationId": "asset-groups.update",
        "summary": "Update an asset group",
        "description": "Changes an asset group's name, description, or whether it is personal. Fields that are omitted are left unchanged.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_GROUPS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroup"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/delete": {
      "post": {
        "operationId": "asset-groups.delete",
        "summary": "Delete an asset group",
        "description": "Soft-deletes an asset group. The assets in it are not changed.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSET_GROUPS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroupsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/add-assets": {
      "post": {
        "operationId": "asset-groups.add-assets",
        "summary": "Add assets to an asset group",
        "description": "Adds assets to an asset group. Assets already in it are left as they are. Fails without adding any if one of the assets doesn't exist.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_GROUPS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsAddAssetsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroupsAddAssetsOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/remove-assets": {
      "post": {
        "operationId": "asset-groups.remove-assets",
        "summary": "Remove assets from an asset group",
        "description": "Takes assets out of an asset group. The assets themselves are not changed. Assets that aren't in the group are ignored.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_GROUPS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsRemoveAssetsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroupsAddAssetsOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/watch": {
      "post": {
        "operationId": "asset-groups.watch",
        "summary": "Watch an asset group",
        "description": "Starts the caller watching an asset group, so they are emailed when assets are added to it or taken out. Each member chooses which of those emails they get in their notification settings. Watching a group already watched changes nothing.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_GROUPS.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsWatchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroup"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-groups/unwatch": {
      "post": {
        "operationId": "asset-groups.unwatch",
        "summary": "Stop watching an asset group",
        "description": "Stops the caller watching an asset group, so they get no more emails about it. Changes nothing if they weren't watching it.",
        "tags": ["asset-groups"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_GROUPS.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetGroupsUnwatchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetGroup"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/notifications/send": {
      "post": {
        "operationId": "notifications.send",
        "summary": "Email members",
        "description": "Emails members of the organisation a short plain-text message, such as a reminder that a delivery is due, optionally linking to one record. The email says who sent it: the App, or the member. Members choose whether they get these emails, and can turn off one App's emails, so don't send anything a member must see. Sending is best effort: a failed email isn't reported.",
        "tags": ["notifications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_USERS.SEND",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationsSendInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotificationsSendOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/label-templates/list": {
      "get": {
        "operationId": "label-templates.list.get",
        "summary": "List label templates",
        "description": "Returns the organisation's label templates: how its asset and location labels look, with their size, sheet layout and elements.",
        "tags": ["label-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LABEL_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return templates whose name contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return templates whose name contains this text (case-insensitive)"
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return templates for assets, or for locations",
              "type": "string",
              "enum": ["ASSET", "LOCATION"]
            },
            "description": "Only return templates for assets, or for locations"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of label templates per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of label templates per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort label templates by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort label templates by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LabelTemplatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "label-templates.list",
        "summary": "List label templates",
        "description": "Returns the organisation's label templates: how its asset and location labels look, with their size, sheet layout and elements.",
        "tags": ["label-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LABEL_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelTemplatesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LabelTemplatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/label-templates/get": {
      "get": {
        "operationId": "label-templates.get.get",
        "summary": "Get a label template",
        "description": "Returns one label template with its elements.",
        "tags": ["label-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LABEL_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the label template"
            },
            "description": "UUID of the label template"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LabelTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "label-templates.get",
        "summary": "Get a label template",
        "description": "Returns one label template with its elements.",
        "tags": ["label-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LABEL_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelTemplatesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LabelTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/label-templates/create": {
      "post": {
        "operationId": "label-templates.create",
        "summary": "Create a label template",
        "description": "Creates a label template: the label's size in millimetres, how labels sit on a sheet (or null for a roll or tape, such as a Brother label printer's), and the elements drawn on each label, positioned in millimetres from its top left corner. Every element must fit on the label, and fields must suit what the label is for. Names are unique, ignoring case.",
        "tags": ["label-templates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "LABEL_TEMPLATES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelTemplatesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LabelTemplate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_ELEMENT, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/label-templates/update": {
      "post": {
        "operationId": "label-templates.update",
        "summary": "Update a label template",
        "description": "Changes a label template's name, size, sheet layout or elements. `elements` replaces every element. What a template is for (assets or locations) can't be changed. Fields that are omitted are left unchanged.",
        "tags": ["label-templates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "LABEL_TEMPLATES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelTemplatesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LabelTemplate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_ELEMENT, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/label-templates/delete": {
      "post": {
        "operationId": "label-templates.delete",
        "summary": "Delete a label template",
        "description": "Soft-deletes a label template. Labels already printed still scan, because they encode the asset or location, not the template.",
        "tags": ["label-templates"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "LABEL_TEMPLATES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelTemplatesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LabelTemplatesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/list": {
      "get": {
        "operationId": "assets.list.get",
        "summary": "List assets",
        "description": "Returns the organisation's assets (the physical stock: individual units and bulk lots), paginated. Search matches any asset ID, the type's name and custom field text such as names and serial numbers. Archived assets are left out unless asked for.",
        "tags": ["assets"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return assets with an asset ID, type name or custom field text containing this (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return assets with an asset ID, type name or custom field text containing this (case-insensitive)"
          },
          {
            "name": "assetTypeUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return assets of this type",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return assets of this type"
          },
          {
            "name": "categoryUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return assets whose type is in this category or its subcategories",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return assets whose type is in this category or its subcategories"
          },
          {
            "name": "storageLocationUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return assets kept at this location or the locations inside it",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return assets kept at this location or the locations inside it"
          },
          {
            "name": "parentUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return assets kept directly in this asset",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return assets kept directly in this asset"
          },
          {
            "name": "manufacturerUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return assets whose type is made by this manufacturer or a manufacturer it owns",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return assets whose type is made by this manufacturer or a manufacturer it owns"
          },
          {
            "name": "groupUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return assets in this asset group. Another member's personal group matches no assets",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return assets in this asset group. Another member's personal group matches no assets"
          },
          {
            "name": "uuids",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return these assets, by UUID (up to 100). UUIDs that aren't assets are ignored",
              "minItems": 1,
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            },
            "description": "Only return these assets, by UUID (up to 100). UUIDs that aren't assets are ignored"
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return archived assets",
              "type": "boolean"
            },
            "description": "Also return archived assets"
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return soft-deleted assets. Needs permission to view deleted assets",
              "type": "boolean"
            },
            "description": "Also return soft-deleted assets. Needs permission to view deleted assets"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of assets per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of assets per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "assetId",
              "description": "Field to sort assets by. Defaults to `assetId`",
              "type": "string",
              "enum": ["assetId", "createdAt", "updatedAt"]
            },
            "description": "Field to sort assets by. Defaults to `assetId`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "assets.list",
        "summary": "List assets",
        "description": "Returns the organisation's assets (the physical stock: individual units and bulk lots), paginated. Search matches any asset ID, the type's name and custom field text such as names and serial numbers. Archived assets are left out unless asked for.",
        "tags": ["assets"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/get": {
      "get": {
        "operationId": "assets.get.get",
        "summary": "Get an asset",
        "description": "Returns one asset with its asset IDs, effective custom field values, the cases it is in, what is kept in it, and the total mass and value of it and its contents.",
        "tags": ["assets"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the asset"
            },
            "description": "UUID of the asset"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "assets.get",
        "summary": "Get an asset",
        "description": "Returns one asset with its asset IDs, effective custom field values, the cases it is in, what is kept in it, and the total mass and value of it and its contents.",
        "tags": ["assets"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/create": {
      "post": {
        "operationId": "assets.create",
        "summary": "Create assets",
        "description": "Creates one or more assets of a type, each with its own asset ID: the IDs given, IDs counting up from a starting ID, or the next IDs from the organisation's sequence. For a bulk type each asset is a lot holding `quantity` items. Nothing is created if any ID is taken.",
        "tags": ["assets"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetsCreateOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, ID_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_TYPE_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, INVALID_CUSTOM_FIELDS, LOCATION_NOT_FOUND, MASS_UNIT_REQUIRED, PARENT_NOT_FOUND, PRICE_STRUCTURE_NOT_FOUND, QUANTITY_NOT_ALLOWED, REJECTED_BY_APP, STARTING_ID_HAS_NO_NUMBER, TOO_DEEP, WRONG_NUMBER_OF_IDS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/update": {
      "post": {
        "operationId": "assets.update",
        "summary": "Update an asset",
        "description": "Changes an asset: its own mass, value, rate or price structure (null falls back to the type's), where it is stored, the case it is kept in, and its custom field values. Fields that are omitted are left unchanged.",
        "tags": ["assets"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Asset"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_CUSTOM_FIELDS, LOCATION_NOT_FOUND, MASS_UNIT_REQUIRED, PARENT_IS_SELF_OR_INSIDE, PARENT_NOT_FOUND, PRICE_STRUCTURE_NOT_FOUND, REJECTED_BY_APP, TOO_DEEP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/archive": {
      "post": {
        "operationId": "assets.archive",
        "summary": "Archive an asset",
        "description": "Archives an asset that has been sold, lost or retired. It is kept, with its history, but hidden from lists and can't be booked.",
        "tags": ["assets"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.ARCHIVE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsArchiveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Asset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_ARCHIVED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/unarchive": {
      "post": {
        "operationId": "assets.unarchive",
        "summary": "Unarchive an asset",
        "description": "Puts an archived asset back into use.",
        "tags": ["assets"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.ARCHIVE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsUnarchiveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Asset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_ARCHIVED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/delete": {
      "post": {
        "operationId": "assets.delete",
        "summary": "Delete an asset",
        "description": "Soft-deletes an asset, for one created by mistake (archive one that is sold or lost instead). Its asset IDs become free to reuse, and anything kept in it is taken out.",
        "tags": ["assets"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSETS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/restore": {
      "post": {
        "operationId": "assets.restore",
        "summary": "Restore an asset",
        "description": "Restores a deleted asset with the asset IDs it had. Refused if another asset has taken one of them since.",
        "tags": ["assets"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.RESTORE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsRestoreInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Asset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, ID_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-ids/add": {
      "post": {
        "operationId": "asset-ids.add",
        "summary": "Add an asset ID",
        "description": "Adds an asset ID to an asset, e.g. a manufacturer's barcode or a new label. With `makePrimary` it becomes the ID shown everywhere, and the old one still scans.",
        "tags": ["asset-ids"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.MANAGE_IDS",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetIdsAddInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Asset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, ID_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-ids/remove": {
      "post": {
        "operationId": "asset-ids.remove",
        "summary": "Remove an asset ID",
        "description": "Removes an asset ID from its asset, freeing it for reuse. An asset's last ID can't be removed; removing the primary ID makes the oldest remaining one primary.",
        "tags": ["asset-ids"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.MANAGE_IDS",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetIdsRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Asset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LAST_ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-ids/set-primary": {
      "post": {
        "operationId": "asset-ids.set-primary",
        "summary": "Make an asset ID primary",
        "description": "Makes an asset ID its asset's primary ID: the one shown in lists, on labels and on documents.",
        "tags": ["asset-ids"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.MANAGE_IDS",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetIdsSetPrimaryInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Asset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-ids/lookup": {
      "get": {
        "operationId": "asset-ids.lookup.get",
        "summary": "Find an asset by asset ID",
        "description": "Returns the live asset with an asset ID (ignoring case), for scanners and links. Any of an asset's IDs finds it.",
        "tags": ["asset-ids"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "value",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "description": "An asset ID as printed or scanned"
            },
            "description": "An asset ID as printed or scanned"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetIdsLookupOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "asset-ids.lookup",
        "summary": "Find an asset by asset ID",
        "description": "Returns the live asset with an asset ID (ignoring case), for scanners and links. Any of an asset's IDs finds it.",
        "tags": ["asset-ids"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetIdsLookupInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetIdsLookupOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-ids/reserve": {
      "post": {
        "operationId": "asset-ids.reserve",
        "summary": "Reserve asset IDs for blank labels",
        "description": "Takes the next free asset IDs from the organisation's sequence without giving them to an asset, so they can be printed as blank labels and stuck on later. New assets never get them from the sequence. Give one to an asset by scanning it, with `asset-ids.add`, or as an asset ID in `assets.create`.",
        "tags": ["asset-ids"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.MANAGE_IDS",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetIdsReserveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetIdsReserveOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/adjust-stock": {
      "post": {
        "operationId": "assets.adjust-stock",
        "summary": "Adjust a lot's stock",
        "description": "Adds items to or takes items from a bulk lot, recording why. The lot's history keeps every change.",
        "tags": ["assets"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.ADJUST_STOCK",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsAdjustStockInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Asset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, STOCK_CHANGED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: BELOW_ZERO, IDEMPOTENCY_KEY_REUSED, NOT_A_LOT, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/assets/stock-history": {
      "get": {
        "operationId": "assets.stock-history.get",
        "summary": "Get a lot's stock history",
        "description": "Returns the changes to a bulk lot's quantity, newest first by default: the opening balance, purchases, write-offs, counts and so on.",
        "tags": ["assets"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the lot"
            },
            "description": "UUID of the lot"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of stock movements per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of stock movements per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort stock movements by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt"]
            },
            "description": "Field to sort stock movements by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetsStockHistoryOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: NOT_A_LOT, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "assets.stock-history",
        "summary": "Get a lot's stock history",
        "description": "Returns the changes to a bulk lot's quantity, newest first by default: the opening balance, purchases, write-offs, counts and so on.",
        "tags": ["assets"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetsStockHistoryInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetsStockHistoryOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: NOT_A_LOT, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-settings/get": {
      "get": {
        "operationId": "asset-settings.get.get",
        "summary": "Get asset settings",
        "description": "Returns how new asset IDs are numbered.",
        "tags": ["asset-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "asset-settings.get",
        "summary": "Get asset settings",
        "description": "Returns how new asset IDs are numbered.",
        "tags": ["asset-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetSettingsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/asset-settings/update": {
      "post": {
        "operationId": "asset-settings.update",
        "summary": "Update asset settings",
        "description": "Changes how new asset IDs are numbered. IDs already given are not changed.",
        "tags": ["asset-settings"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetSettings"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/localisation-settings/get": {
      "get": {
        "operationId": "localisation-settings.get.get",
        "summary": "Get localisation settings",
        "description": "Returns the currency the organisation hires in (and whether it can still change), its timezone, the language documents for clients are written in, and the unit system masses are shown in.",
        "tags": ["localisation-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocalisationSettingsWithLock"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "localisation-settings.get",
        "summary": "Get localisation settings",
        "description": "Returns the currency the organisation hires in (and whether it can still change), its timezone, the language documents for clients are written in, and the unit system masses are shown in.",
        "tags": ["localisation-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalisationSettingsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocalisationSettingsWithLock"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/localisation-settings/update": {
      "post": {
        "operationId": "localisation-settings.update",
        "summary": "Update localisation settings",
        "description": "Changes the organisation's currency, timezone, document language or unit system. Amounts already entered are not converted, so the currency can't change once projects have prices, quotes, invoices or payments.",
        "tags": ["localisation-settings"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalisationSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocalisationSettingsWithLock"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: CURRENCY_LOCKED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/security-settings/get": {
      "get": {
        "operationId": "security-settings.get.get",
        "summary": "Get security settings",
        "description": "Returns which roles must use two-factor authentication, and how long members can go without using the organisation before they are signed out.",
        "tags": ["security-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SecuritySettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "security-settings.get",
        "summary": "Get security settings",
        "description": "Returns which roles must use two-factor authentication, and how long members can go without using the organisation before they are signed out.",
        "tags": ["security-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecuritySettingsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SecuritySettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/security-settings/update": {
      "post": {
        "operationId": "security-settings.update",
        "summary": "Update security settings",
        "description": "Changes which roles must use two-factor authentication, or when idle members are signed out. Members of a role that now needs two-factor authentication can't use the organisation until they set it up.",
        "tags": ["security-settings"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecuritySettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SecuritySettings"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/backups/get-schedule": {
      "get": {
        "operationId": "backups.get-schedule.get",
        "summary": "Get the backup schedule",
        "description": "Returns the hour the organisation's database is backed up each day, and when the next backup runs.",
        "tags": ["backups"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BackupsGetScheduleOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "backups.get-schedule",
        "summary": "Get the backup schedule",
        "description": "Returns the hour the organisation's database is backed up each day, and when the next backup runs.",
        "tags": ["backups"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupsGetScheduleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BackupsGetScheduleOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/backups/set-schedule": {
      "post": {
        "operationId": "backups.set-schedule",
        "summary": "Set the backup schedule",
        "description": "Backs up the organisation's database every day at the given hour (UTC). Pick a quiet hour: members can't use the organisation while a backup runs.",
        "tags": ["backups"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupsSetScheduleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BackupsGetScheduleOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/backups/create": {
      "post": {
        "operationId": "backups.create",
        "summary": "Back up now",
        "description": "Backs up the organisation's database straight away. Members can't use the organisation for the few seconds it takes. The backup is saved in the `DATABASE_BACKUPS` file category.",
        "tags": ["backups"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BackupsCreateOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: BACKUP_FAILED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/audit-logs/list": {
      "get": {
        "operationId": "audit-logs.list.get",
        "summary": "Read the audit log",
        "description": "Returns what happened in the organisation over the last 90 days, newest first: who did what, and what changed. Can show only one member's actions, or only the history of one record, such as a project. Reading the log is itself recorded in it.",
        "tags": ["audit-logs"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "AUDIT_LOGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only events before this time. Pass the previous page's `nextBefore` for the next page",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "description": "Only events before this time. Pass the previous page's `nextBefore` for the next page"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "description": "How many events to return, newest first. Up to 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "How many events to return, newest first. Up to 100"
          },
          {
            "name": "actorUserUuid",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only events done by this member",
              "type": "string",
              "maxLength": 64
            },
            "description": "Only events done by this member"
          },
          {
            "name": "recordUuid",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only events about this record, such as a project's UUID, including changes to its lines and crew",
              "type": "string",
              "maxLength": 64
            },
            "description": "Only events about this record, such as a project's UUID, including changes to its lines and crew"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only events whose description contains this text. Needs `actorUserUuid` or `recordUuid` too",
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Only events whose description contains this text. Needs `actorUserUuid` or `recordUuid` too"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AuditLogsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "audit-logs.list",
        "summary": "Read the audit log",
        "description": "Returns what happened in the organisation over the last 90 days, newest first: who did what, and what changed. Can show only one member's actions, or only the history of one record, such as a project. Reading the log is itself recorded in it.",
        "tags": ["audit-logs"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "AUDIT_LOGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditLogsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AuditLogsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/public-site/get": {
      "get": {
        "operationId": "public-site.get.get",
        "summary": "Get public site settings",
        "description": "Returns what the organisation's public site shows: whether it is on, the hire catalogue and which categories it shows, whether it shows prices, whether visitors can send enquiries (and the status and manager enquiry projects get), and whether crew vacancies are listed.",
        "tags": ["public-site"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PublicSiteSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "public-site.get",
        "summary": "Get public site settings",
        "description": "Returns what the organisation's public site shows: whether it is on, the hire catalogue and which categories it shows, whether it shows prices, whether visitors can send enquiries (and the status and manager enquiry projects get), and whether crew vacancies are listed.",
        "tags": ["public-site"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicSiteGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PublicSiteSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/public-site/update": {
      "post": {
        "operationId": "public-site.update",
        "summary": "Update public site settings",
        "description": "Changes what the organisation's public site shows. Anyone can open the public site without signing in, so turning it on, or showing prices, makes that information public.",
        "tags": ["public-site"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicSiteUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PublicSiteSettings"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CATEGORY_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PERSON_NOT_FOUND, STATUS_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/search/query": {
      "get": {
        "operationId": "search.query.get",
        "summary": "Search the organisation",
        "description": "Finds asset types, assets (by their tags and serial numbers), projects (by name, number or description), clients, locations, wiki pages and members (by name, email address or job title) whose name or text contains every word searched for. Only returns the kinds of record the caller may see, and only the wiki pages open to their role.",
        "tags": ["search"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "SEARCH.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "description": "What to look for. Every word must appear, as the start of a word, in the record's name or text. For example: `source four` finds the asset type ETC Source Four Jr"
            },
            "description": "What to look for. Every word must appear, as the start of a word, in the record's name or text. For example: `source four` finds the asset type ETC Source Four Jr"
          },
          {
            "name": "kinds",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only these kinds of record. Leave out for every kind the caller may see",
              "maxItems": 7,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "asset-type",
                  "asset",
                  "project",
                  "client",
                  "location",
                  "wiki-page",
                  "member"
                ]
              }
            },
            "description": "Only these kinds of record. Leave out for every kind the caller may see"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "description": "How many results to return, best match first (1 to 50)",
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "description": "How many results to return, best match first (1 to 50)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchQueryOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "search.query",
        "summary": "Search the organisation",
        "description": "Finds asset types, assets (by their tags and serial numbers), projects (by name, number or description), clients, locations, wiki pages and members (by name, email address or job title) whose name or text contains every word searched for. Only returns the kinds of record the caller may see, and only the wiki pages open to their role.",
        "tags": ["search"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "SEARCH.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchQueryInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchQueryOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/organisation-details/get": {
      "get": {
        "operationId": "organisation-details.get.get",
        "summary": "Get the organisation's details",
        "description": "Returns the organisation's name, who members contact for help, and the address, phone, email, website and tax and company registration printed on documents for clients.",
        "tags": ["organisation-details"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationDetails"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organisation-details.get",
        "summary": "Get the organisation's details",
        "description": "Returns the organisation's name, who members contact for help, and the address, phone, email, website and tax and company registration printed on documents for clients.",
        "tags": ["organisation-details"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationDetailsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationDetails"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/organisation-details/update": {
      "post": {
        "operationId": "organisation-details.update",
        "summary": "Update the organisation's details",
        "description": "Changes the organisation's name, support contact details, address, phone, email, website or tax and company registration. Fields left out keep their value; null clears one.",
        "tags": ["organisation-details"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationDetailsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationDetails"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/organisation-details/set-email-header": {
      "post": {
        "operationId": "organisation-details.set-email-header",
        "summary": "Set the organisation's email header",
        "description": "Sets the image shown at the top of emails sent about the organisation, such as comment notifications and invitations, replacing any it had.",
        "tags": ["organisation-details"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationDetailsSetEmailHeaderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationDetails"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_IMAGE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/organisation-details/remove-email-header": {
      "post": {
        "operationId": "organisation-details.remove-email-header",
        "summary": "Remove the organisation's email header",
        "description": "Removes the organisation's email header. Emails sent about it then show the AdamRMS logo.",
        "tags": ["organisation-details"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationDetailsRemoveEmailHeaderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationDetails"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/organisation-details/set-logo": {
      "post": {
        "operationId": "organisation-details.set-logo",
        "summary": "Set the organisation's logo",
        "description": "Sets the logo shown in the navigation, on documents for clients such as quotes and invoices, and on labels, replacing any it had. A PNG or WebP keeps a transparent background.",
        "tags": ["organisation-details"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationDetailsSetLogoInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationDetails"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_IMAGE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/organisation-details/remove-logo": {
      "post": {
        "operationId": "organisation-details.remove-logo",
        "summary": "Remove the organisation's logo",
        "description": "Removes the organisation's logo. The navigation then shows the organisation's name.",
        "tags": ["organisation-details"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationDetailsRemoveLogoInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationDetails"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/ai-usage/get-allowance": {
      "get": {
        "operationId": "ai-usage.get-allowance.get",
        "summary": "Get the organisation's AdamRMS AI allowance",
        "description": "Returns what the organisation's AdamRMS AI use this month is worth in its currency, what its plan includes, and whether members can still prompt AdamRMS AI. Once the allowance is used, AdamRMS AI stops until the next month.",
        "tags": ["ai-usage"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "AI_USAGE.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AiUsageGetAllowanceOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "ai-usage.get-allowance",
        "summary": "Get the organisation's AdamRMS AI allowance",
        "description": "Returns what the organisation's AdamRMS AI use this month is worth in its currency, what its plan includes, and whether members can still prompt AdamRMS AI. Once the allowance is used, AdamRMS AI stops until the next month.",
        "tags": ["ai-usage"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "AI_USAGE.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiUsageGetAllowanceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AiUsageGetAllowanceOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/price-structures/list": {
      "get": {
        "operationId": "price-structures.list.get",
        "summary": "List price structures",
        "description": "Returns the organisation's price structures: the rules that turn the length of a hire into a multiple of an item's rate (e.g. 'Daily', '3-day week', 'Fixed'). One of them is the default.",
        "tags": ["price-structures"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PRICE_STRUCTURES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of price structures per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of price structures per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort price structures by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt"]
            },
            "description": "Field to sort price structures by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceStructuresListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "price-structures.list",
        "summary": "List price structures",
        "description": "Returns the organisation's price structures: the rules that turn the length of a hire into a multiple of an item's rate (e.g. 'Daily', '3-day week', 'Fixed'). One of them is the default.",
        "tags": ["price-structures"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PRICE_STRUCTURES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceStructuresListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceStructuresListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/price-structures/create": {
      "post": {
        "operationId": "price-structures.create",
        "summary": "Create a price structure",
        "description": "Creates a price structure from a table of cumulative factors. A name already used by another price structure (ignoring case) is refused.",
        "tags": ["price-structures"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PRICE_STRUCTURES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceStructuresCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceStructure"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/price-structures/update": {
      "post": {
        "operationId": "price-structures.update",
        "summary": "Update a price structure",
        "description": "Changes a price structure, or makes it the default. Fields that are omitted are left unchanged. Prices already agreed on bookings keep the structure as it was when they were made.",
        "tags": ["price-structures"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PRICE_STRUCTURES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceStructuresUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceStructure"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: DEFAULT_REQUIRED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/price-structures/delete": {
      "post": {
        "operationId": "price-structures.delete",
        "summary": "Delete a price structure",
        "description": "Deletes a price structure. The default structure can't be deleted: make another structure the default first. Nor can one that asset types, assets or client pricing entries use.",
        "tags": ["price-structures"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PRICE_STRUCTURES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceStructuresDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceStructuresDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, IN_USE, IS_DEFAULT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/tax-rates/list": {
      "get": {
        "operationId": "tax-rates.list.get",
        "summary": "List tax rates",
        "description": "Returns the organisation's tax rates, such as 'Standard 20%' and 'Zero rated'. Prices are net, and each line on a project is taxed at its rate. One rate is the default, for anything without its own.",
        "tags": ["tax-rates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of tax rates per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of tax rates per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "position",
              "description": "Field to sort tax rates by. Defaults to `position`",
              "type": "string",
              "enum": ["position", "name"]
            },
            "description": "Field to sort tax rates by. Defaults to `position`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "tax-rates.list",
        "summary": "List tax rates",
        "description": "Returns the organisation's tax rates, such as 'Standard 20%' and 'Zero rated'. Prices are net, and each line on a project is taxed at its rate. One rate is the default, for anything without its own.",
        "tags": ["tax-rates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRatesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/tax-rates/create": {
      "post": {
        "operationId": "tax-rates.create",
        "summary": "Create a tax rate",
        "description": "Creates a tax rate at the end of the list. The organisation's first rate becomes the default. A name already used by another rate (ignoring case) is refused.",
        "tags": ["tax-rates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRatesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN, TOO_MANY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/tax-rates/update": {
      "post": {
        "operationId": "tax-rates.update",
        "summary": "Update a tax rate",
        "description": "Changes a tax rate, or makes it the default. Fields that are omitted are left unchanged. Lines already on projects keep the rate they were priced at until their prices are refreshed.",
        "tags": ["tax-rates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRatesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/tax-rates/reorder": {
      "post": {
        "operationId": "tax-rates.reorder",
        "summary": "Move a tax rate",
        "description": "Moves a tax rate to a new position in the list, which is the order pickers show them in.",
        "tags": ["tax-rates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRatesReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/tax-rates/delete": {
      "post": {
        "operationId": "tax-rates.delete",
        "summary": "Delete a tax rate",
        "description": "Deletes a tax rate. Asset types, packages and services that used it go back to the default rate, and projects that overrode their tax with it stop overriding. Lines already on projects keep the rate they were priced at. Deleting the default makes the first remaining rate the default.",
        "tags": ["tax-rates"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRatesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRatesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/tax-rates/add-preset": {
      "post": {
        "operationId": "tax-rates.add-preset",
        "summary": "Add a country's tax rates",
        "description": "Adds a ready-made set of tax rates, such as the UK's VAT rates. Rates with the same name as one the organisation has are skipped, and the tax name is set if it hasn't been.",
        "tags": ["tax-rates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRatesAddPresetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRatesAddPresetOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/tax-settings/get": {
      "get": {
        "operationId": "tax-settings.get.get",
        "summary": "Get tax settings",
        "description": "Returns what tax is called on the organisation's documents, such as 'VAT' or 'GST'.",
        "tags": ["tax-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "tax-settings.get",
        "summary": "Get tax settings",
        "description": "Returns what tax is called on the organisation's documents, such as 'VAT' or 'GST'.",
        "tags": ["tax-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxSettingsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/tax-settings/update": {
      "post": {
        "operationId": "tax-settings.update",
        "summary": "Update tax settings",
        "description": "Changes what tax is called on the organisation's documents, such as 'VAT' or 'GST'.",
        "tags": ["tax-settings"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxSettings"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/services/list": {
      "get": {
        "operationId": "services.list.get",
        "summary": "List services",
        "description": "Returns the organisation's services: things it charges for that aren't stock, such as delivery, a technician day or PAT testing. Each can be added to a project as a priced line.",
        "tags": ["services"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return services whose name contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return services whose name contains this text (case-insensitive)"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of services per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of services per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort services by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort services by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServicesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "services.list",
        "summary": "List services",
        "description": "Returns the organisation's services: things it charges for that aren't stock, such as delivery, a technician day or PAT testing. Each can be added to a project as a priced line.",
        "tags": ["services"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServicesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServicesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/services/create": {
      "post": {
        "operationId": "services.create",
        "summary": "Create a service",
        "description": "Creates a service. A name already used by another service (ignoring case) is refused. It can list the certifications crew charged as it need.",
        "tags": ["services"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServicesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Service"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PRICE_STRUCTURE_NOT_FOUND, TAX_RATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CERTIFICATION_TYPE_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/services/update": {
      "post": {
        "operationId": "services.update",
        "summary": "Update a service",
        "description": "Changes a service. Fields that are omitted are left unchanged. Lines already on projects keep their price until their prices are refreshed.",
        "tags": ["services"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServicesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Service"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, PRICE_STRUCTURE_NOT_FOUND, TAX_RATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CERTIFICATION_TYPE_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/services/delete": {
      "post": {
        "operationId": "services.delete",
        "summary": "Delete a service",
        "description": "Deletes a service, so it can't be added to projects. Lines already on projects stay, with their price.",
        "tags": ["services"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServicesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServicesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-roles/list": {
      "get": {
        "operationId": "crew-roles.list.get",
        "summary": "List crew roles",
        "description": "Returns the organisation's crew roles: roles it recruits for again and again, such as a lighting designer, each with what it involves. A crew vacancy can name one, and shows its description.",
        "tags": ["crew-roles"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return crew roles whose name contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return crew roles whose name contains this text (case-insensitive)"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of crew roles per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of crew roles per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort crew roles by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort crew roles by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewRolesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crew-roles.list",
        "summary": "List crew roles",
        "description": "Returns the organisation's crew roles: roles it recruits for again and again, such as a lighting designer, each with what it involves. A crew vacancy can name one, and shows its description.",
        "tags": ["crew-roles"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewRolesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewRolesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-roles/create": {
      "post": {
        "operationId": "crew-roles.create",
        "summary": "Create a crew role",
        "description": "Creates a crew role, with a description that vacancies for it show. A name already used by another crew role (ignoring case) is refused.",
        "tags": ["crew-roles"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewRolesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewRole"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-roles/update": {
      "post": {
        "operationId": "crew-roles.update",
        "summary": "Update a crew role",
        "description": "Changes a crew role. Fields that are omitted are left unchanged. Every vacancy for it shows the new description straight away.",
        "tags": ["crew-roles"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewRolesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewRole"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-roles/delete": {
      "post": {
        "operationId": "crew-roles.delete",
        "summary": "Delete a crew role",
        "description": "Deletes a crew role, so new vacancies can't use it. Vacancies that used it stay, with their own description, but no longer show the crew role's.",
        "tags": ["crew-roles"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewRolesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewRolesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-templates/list": {
      "get": {
        "operationId": "project-templates.list.get",
        "summary": "List project templates",
        "description": "Returns the organisation's project templates: projects saved to start others from, each with the lines, crew roles and notes it adds. Start a project from one with projects.create and its templateUUID.",
        "tags": ["project-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return templates whose name contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return templates whose name contains this text (case-insensitive)"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of templates per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of templates per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort templates by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort templates by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTemplatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-templates.list",
        "summary": "List project templates",
        "description": "Returns the organisation's project templates: projects saved to start others from, each with the lines, crew roles and notes it adds. Start a project from one with projects.create and its templateUUID.",
        "tags": ["project-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTemplatesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTemplatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-templates/get": {
      "get": {
        "operationId": "project-templates.get.get",
        "summary": "Get a project template",
        "description": "Returns a project template with the lines, crew roles and notes it adds to a project started from it.",
        "tags": ["project-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the template"
            },
            "description": "UUID of the template"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-templates.get",
        "summary": "Get a project template",
        "description": "Returns a project template with the lines, crew roles and notes it adds to a project started from it.",
        "tags": ["project-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTemplatesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-templates/create": {
      "post": {
        "operationId": "project-templates.create",
        "summary": "Save a project as a template",
        "description": "Saves a project's own lines, crew roles and notes as a template, with the project's type. Accessories and package contents come with their line, so aren't saved separately. Sub-hire, assets allocated, who is on the crew (and what their places charge), and the project's dates, client and prices aren't saved. A name already used by another template (ignoring case) is refused.",
        "tags": ["project-templates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_TEMPLATES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTemplatesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTemplate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-templates/update": {
      "post": {
        "operationId": "project-templates.update",
        "summary": "Rename a project template",
        "description": "Changes a template's name or description. To change what it holds, save a project as a new template.",
        "tags": ["project-templates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_TEMPLATES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTemplatesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTemplate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-templates/delete": {
      "post": {
        "operationId": "project-templates.delete",
        "summary": "Delete a project template",
        "description": "Deletes a project template. Projects already started from it don't change.",
        "tags": ["project-templates"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PROJECT_TEMPLATES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTemplatesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTemplatesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-lines/list": {
      "get": {
        "operationId": "project-lines.list.get",
        "summary": "List what's on a project",
        "description": "Returns everything on a project's quote: asset types, assets, packages, services, charges and sub-hire, with what's allocated to each line, how much of each asset type is free over the project's dates, and the project's totals. Lines can be grouped, such as by category, with counts for each group of what's short or still to allocate. Ask for some groups only, or search and filter, to page through a project with thousands of lines.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project"
            },
            "description": "UUID of the project"
          },
          {
            "name": "includeSubProjects",
            "in": "query",
            "required": false,
            "schema": {
              "default": true,
              "description": "Include the lines on its sub-projects. Defaults to true",
              "type": "boolean"
            },
            "description": "Include the lines on its sub-projects. Defaults to true"
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "schema": {
              "default": "NONE",
              "description": "How to group the lines in `groups`: NONE (one group), CATEGORY (by the asset type's category, then packages, then services and charges) or SUB_PROJECT. Each top-level line and everything under it is in one group. Defaults to NONE",
              "type": "string",
              "enum": ["NONE", "CATEGORY", "SUB_PROJECT"]
            },
            "description": "How to group the lines in `groups`: NONE (one group), CATEGORY (by the asset type's category, then packages, then services and charges) or SUB_PROJECT. Each top-level line and everything under it is in one group. Defaults to NONE"
          },
          {
            "name": "groups",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return the lines in these groups, by their `key`. An empty list returns no lines, only the groups and counts. Omit for every group",
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 80
              }
            },
            "description": "Only return the lines in these groups, by their `key`. An empty list returns no lines, only the groups and counts. Omit for every group"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only lines whose description, comment or allocated asset IDs contain this text, with the lines above them",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only lines whose description, comment or allocated asset IDs contain this text, with the lines above them"
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only lines that are SHORT (need more than is free), TO_ALLOCATE (need more assets allocated) or SUB_HIRE (have stock hired in), with the lines above them",
              "type": "string",
              "enum": ["SHORT", "TO_ALLOCATE", "SUB_HIRE"]
            },
            "description": "Only lines that are SHORT (need more than is free), TO_ALLOCATE (need more assets allocated) or SUB_HIRE (have stock hired in), with the lines above them"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLinesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-lines.list",
        "summary": "List what's on a project",
        "description": "Returns everything on a project's quote: asset types, assets, packages, services, charges and sub-hire, with what's allocated to each line, how much of each asset type is free over the project's dates, and the project's totals. Lines can be grouped, such as by category, with counts for each group of what's short or still to allocate. Ask for some groups only, or search and filter, to page through a project with thousands of lines.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectLinesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLinesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-lines/add": {
      "post": {
        "operationId": "project-lines.add",
        "summary": "Add to a project",
        "description": "Adds a line to a project, priced from the catalogue through the project's client pricing. An asset type brings its mandatory and default accessories under it, free. A package brings its contents. An asset is allocated straight away, with what's in it if it's a case. More of an asset type than is free can be added: the line shows a shortage.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectLinesAddInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLinesAddOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DESCRIPTION_REQUIRED, DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, ASSET_TYPE_NOT_FOUND, CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, PACKAGE_NOT_FOUND, SERVICE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_ON_PROJECT, ASSETS_OFF, ASSET_BLOCKED, ASSET_UNAVAILABLE, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_STOCK, TOO_MANY_FOR_LOT, WRONG_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-lines/add-group": {
      "post": {
        "operationId": "project-lines.add-group",
        "summary": "Add an asset group to a project",
        "description": "Adds every asset in an asset group to a project, each on its own line and allocated, as adding each asset would. One of a lot is added; change its line's quantity for more. An asset that's blocked, out on another confirmed project at the same time, or already on this project is left out and listed, and the rest are still added.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectLinesAddGroupInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLinesAddGroupOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, GROUP_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ASSETS_OFF, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-lines/update": {
      "post": {
        "operationId": "project-lines.update",
        "summary": "Change a line on a project",
        "description": "Changes a line's quantity, description, comment, discount, custom price, units, tax rate, cost or dates. Fields that are omitted are left unchanged. Changing what it charges needs permission to see prices.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectLinesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLine"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, LINE_NOT_FOUND, ORGANISATION_NOT_FOUND, TAX_RATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: BELOW_ALLOCATED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-lines/remove": {
      "post": {
        "operationId": "project-lines.remove",
        "summary": "Remove a line from a project",
        "description": "Removes a line from a project, with the lines under it (accessories, package contents and case contents) and their allocations. The assets are free for other projects again. A line on an issued invoice can't be removed until that invoice is credited; draft invoices lose it.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectLinesRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLinesRemoveOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, LINE_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LINE_INVOICED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-lines/reorder": {
      "post": {
        "operationId": "project-lines.reorder",
        "summary": "Move a line on a project",
        "description": "Moves a line among the lines next to it, which is the order it shows on the quote.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectLinesReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLine"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, LINE_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-lines/refresh-prices": {
      "post": {
        "operationId": "project-lines.refresh-prices",
        "summary": "Refresh a project's prices",
        "description": "Copies the catalogue's current rates, price structures, client pricing and tax rates onto a project's lines, or one line. Discounts, custom prices and units set on a line are kept. Prices are otherwise fixed when a line is added, so changing the catalogue never changes a project already priced.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectLinesRefreshPricesInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLinesRefreshPricesOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, LINE_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-allocations/allocate": {
      "post": {
        "operationId": "project-allocations.allocate",
        "summary": "Allocate an asset to a line",
        "description": "Puts a specific asset on a line of its asset type. An individual unit can't be on two confirmed projects whose dates overlap, or on one project twice, and a blocked one can't be booked. A lot can't give more than it has free.",
        "tags": ["project-allocations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectAllocationsAllocateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLine"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, FUNCTION_NOT_FOUND, LINE_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_ON_PROJECT, ASSET_BLOCKED, ASSET_UNAVAILABLE, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_STOCK, TOO_MANY_FOR_LOT, WRONG_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-allocations/allocate-many": {
      "post": {
        "operationId": "project-allocations.allocate-many",
        "summary": "Allocate several assets to a line",
        "description": "Puts several assets on a line of their asset type at once, such as the free ones project-lines.free-assets lists. Each is checked as allocating it alone would be: one that's blocked, on another confirmed project at the same time or already on this project is left out and listed, and the rest are still allocated.",
        "tags": ["project-allocations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectAllocationsAllocateManyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectAllocationsAllocateManyOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, LINE_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-lines/free-assets": {
      "get": {
        "operationId": "project-lines.free-assets.get",
        "summary": "List assets free for a line",
        "description": "Returns the assets of a line's asset type that are free for the line's dates, with where each is kept and when it's next due an inspection, and those that aren't free and why: on another confirmed project (and when it's back), on another line of this project, or blocked by maintenance. Use it to choose what to allocate.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "lineUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the line to fill. It must take stock"
            },
            "description": "UUID of the line to fill. It must take stock"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLinesFreeAssetsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, LINE_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: NOT_STOCK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-lines.free-assets",
        "summary": "List assets free for a line",
        "description": "Returns the assets of a line's asset type that are free for the line's dates, with where each is kept and when it's next due an inspection, and those that aren't free and why: on another confirmed project (and when it's back), on another line of this project, or blocked by maintenance. Use it to choose what to allocate.",
        "tags": ["project-lines"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectLinesFreeAssetsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLinesFreeAssetsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, LINE_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: NOT_STOCK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-allocations/release": {
      "post": {
        "operationId": "project-allocations.release",
        "summary": "Take an asset off a line",
        "description": "Takes an allocated asset off its line, with anything allocated because it's in it. The line stays, with fewer allocated.",
        "tags": ["project-allocations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectAllocationsReleaseInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLine"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ALLOCATION_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-allocations/set-progress": {
      "post": {
        "operationId": "project-allocations.set-progress",
        "summary": "Mark an asset prepped, out or back",
        "description": "Marks an allocated asset prepped, sent out or back by hand, as scanning in a project's session does, and records how many of it didn't come back. Taking a mark off takes the later ones off too. Anything packed in it gets the same marks.",
        "tags": ["project-allocations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectAllocationsSetProgressInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLine"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ALLOCATION_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_DISPATCHED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY_MISSING",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-allocations/swap": {
      "post": {
        "operationId": "project-allocations.swap",
        "summary": "Swap an allocated asset",
        "description": "Puts another asset of the same type in an allocation's place, such as when one fails in prep. Its prep, dispatch and return are cleared.",
        "tags": ["project-allocations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectAllocationsSwapInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLine"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ALLOCATION_NOT_FOUND, ASSET_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_ON_PROJECT, ASSET_BLOCKED, ASSET_UNAVAILABLE, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_STOCK, TOO_MANY_FOR_LOT, WRONG_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/sub-hires/set": {
      "post": {
        "operationId": "sub-hires.set",
        "summary": "Add or change a sub-hire",
        "description": "Records stock hired in from a supplier to fill a line, such as 20 more LED pars from another hire company. What's hired in counts as stock for that line only.",
        "tags": ["sub-hires"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubHiresSetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLine"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, LINE_NOT_FOUND, ORGANISATION_NOT_FOUND, SUB_HIRE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_STOCK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/sub-hires/remove": {
      "post": {
        "operationId": "sub-hires.remove",
        "summary": "Remove a sub-hire",
        "description": "Removes a sub-hire from its line. The line stays.",
        "tags": ["sub-hires"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubHiresRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectLine"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, SUB_HIRE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/availability/check": {
      "get": {
        "operationId": "availability.check.get",
        "summary": "Check availability",
        "description": "Returns how much of each asset type is free over a period, or for a project: total stock, what's booked on confirmed projects, what's held on provisional ones and what maintenance blocks.",
        "tags": ["availability"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetTypeUUIDs",
            "in": "query",
            "required": true,
            "schema": {
              "minItems": 1,
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "description": "The asset types to check, up to 100"
            },
            "description": "The asset types to check, up to 100"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Start of the period. With end, or give a project",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Start of the period. With end, or give a project"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "description": "End of the period",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "End of the period"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Check for this project: its out period, unless start and end are given, and leaving out its own lines",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Check for this project: its out period, unless start and end are given, and leaving out its own lines"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AvailabilityCheckOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "availability.check",
        "summary": "Check availability",
        "description": "Returns how much of each asset type is free over a period, or for a project: total stock, what's booked on confirmed projects, what's held on provisional ones and what maintenance blocks.",
        "tags": ["availability"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvailabilityCheckInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AvailabilityCheckOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-pricing/list": {
      "get": {
        "operationId": "client-pricing.list.get",
        "summary": "List client pricing",
        "description": "Returns the organisation's client pricing: named alternative prices, such as 'Trade' or 'Dry hire', that a client's projects can use instead of catalogue prices.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENT_PRICING.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of client pricing per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of client pricing per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort client pricing by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt"]
            },
            "description": "Field to sort client pricing by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricingListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "client-pricing.list",
        "summary": "List client pricing",
        "description": "Returns the organisation's client pricing: named alternative prices, such as 'Trade' or 'Dry hire', that a client's projects can use instead of catalogue prices.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENT_PRICING.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPricingListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricingListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-pricing/get": {
      "get": {
        "operationId": "client-pricing.get.get",
        "summary": "Get client pricing",
        "description": "Returns one client pricing with its entries: the prices it sets for particular asset types and categories.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENT_PRICING.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the client pricing"
            },
            "description": "UUID of the client pricing"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricingDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "client-pricing.get",
        "summary": "Get client pricing",
        "description": "Returns one client pricing with its entries: the prices it sets for particular asset types and categories.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENT_PRICING.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPricingGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricingDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-pricing/create": {
      "post": {
        "operationId": "client-pricing.create",
        "summary": "Create client pricing",
        "description": "Creates client pricing, optionally with a percentage applied to everything it has no entry for. A name already used by another client pricing (ignoring case) is refused.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENT_PRICING.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPricingCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricing"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-pricing/update": {
      "post": {
        "operationId": "client-pricing.update",
        "summary": "Update client pricing",
        "description": "Changes client pricing's name, description, percentage or dates. Fields that are omitted are left unchanged. Prices already agreed on projects don't change.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENT_PRICING.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPricingUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricing"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: DATES_OUT_OF_ORDER, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-pricing/delete": {
      "post": {
        "operationId": "client-pricing.delete",
        "summary": "Delete client pricing",
        "description": "Deletes client pricing. Clients that used it go back to catalogue prices; prices already agreed on projects don't change.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "CLIENT_PRICING.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPricingDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricingDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-pricing/set-entry": {
      "post": {
        "operationId": "client-pricing.set-entry",
        "summary": "Set client pricing's price for a type or category",
        "description": "Sets the price a list charges for one asset type (a fixed rate or a percentage) or for every type in a category (a percentage), and optionally a different price structure. Replaces the list's existing entry for that type or category.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENT_PRICING.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPricingSetEntryInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricingEntry"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_TYPE_NOT_FOUND, CATEGORY_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, PRICE_STRUCTURE_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-pricing/remove-entry": {
      "post": {
        "operationId": "client-pricing.remove-entry",
        "summary": "Remove client pricing entry",
        "description": "Removes one entry from client pricing, so that type or category is priced by the next entry up the category tree, or the list's own percentage.",
        "tags": ["client-pricing"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENT_PRICING.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPricingRemoveEntryInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientPricingRemoveEntryOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/clients/set-pricing": {
      "post": {
        "operationId": "clients.set-pricing",
        "summary": "Set a client's pricing",
        "description": "Chooses the client pricing a client's new projects use, or none for catalogue prices.",
        "tags": ["clients"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientsSetPricingInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientsSetPricingOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/prices/preview": {
      "get": {
        "operationId": "prices.preview.get",
        "summary": "Preview prices",
        "description": "Works out what an asset type, or one asset, costs to hire for given lengths of hire, from the catalogue or through client pricing. Returns the rate, where it came from, the price structure and a price per length.",
        "tags": ["prices"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetTypeUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "UUID of the asset type to price. Give this or `assetUUID`",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUID of the asset type to price. Give this or `assetUUID`"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "UUID of one asset to price, using its own rate if it has one",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUID of one asset to price, using its own rate if it has one"
          },
          {
            "name": "clientPricingUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "UUID of client pricing to price through. Omit for catalogue prices",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUID of client pricing to price through. Omit for catalogue prices"
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "schema": {
              "default": [1],
              "description": "Hire lengths to price, in the structure's units (days for a daily structure). Defaults to [1]",
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              }
            },
            "description": "Hire lengths to price, in the structure's units (days for a daily structure). Defaults to [1]"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PricesPreviewOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, ASSET_TYPE_NOT_FOUND, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "prices.preview",
        "summary": "Preview prices",
        "description": "Works out what an asset type, or one asset, costs to hire for given lengths of hire, from the catalogue or through client pricing. Returns the rate, where it came from, the price structure and a price per length.",
        "tags": ["prices"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PricesPreviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PricesPreviewOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, ASSET_TYPE_NOT_FOUND, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/custom-fields/list": {
      "get": {
        "operationId": "custom-fields.list.get",
        "summary": "List custom fields",
        "description": "Returns the custom fields defined for a record type (assets), in the order they appear on the form, with their type, settings and whether they are required.",
        "tags": ["custom-fields"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CUSTOM_FIELDS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "recordType",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asset",
              "description": "Which record type's fields to list",
              "type": "string",
              "enum": ["asset"]
            },
            "description": "Which record type's fields to list"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomFieldsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "custom-fields.list",
        "summary": "List custom fields",
        "description": "Returns the custom fields defined for a record type (assets), in the order they appear on the form, with their type, settings and whether they are required.",
        "tags": ["custom-fields"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CUSTOM_FIELDS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFieldsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomFieldsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/custom-fields/create": {
      "post": {
        "operationId": "custom-fields.create",
        "summary": "Create a custom field",
        "description": "Adds a custom field to a record type's form, after the existing fields. A field can be used by every asset type or only chosen ones. It can be optional, required on every record, or required only for records in chosen asset categories (and their subcategories). Settings that don't apply to the field's type are ignored. At most 100 fields per record type.",
        "tags": ["custom-fields"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CUSTOM_FIELDS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFieldsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomField"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LIMIT_REACHED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_TYPE_NOT_FOUND, CATEGORY_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, INVALID_SETTINGS, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/custom-fields/update": {
      "post": {
        "operationId": "custom-fields.update",
        "summary": "Update a custom field",
        "description": "Changes a custom field's name, help text, requirement or settings. The type can't be changed. Fields that are omitted are left unchanged. Stored values are not re-checked until their record is next saved.",
        "tags": ["custom-fields"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CUSTOM_FIELDS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFieldsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomField"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_TYPE_NOT_FOUND, CATEGORY_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, INVALID_SETTINGS, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/custom-fields/reorder": {
      "post": {
        "operationId": "custom-fields.reorder",
        "summary": "Reorder a custom field",
        "description": "Moves a custom field to a new position on the form and renumbers the others to match.",
        "tags": ["custom-fields"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CUSTOM_FIELDS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFieldsReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomField"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/custom-fields/delete": {
      "post": {
        "operationId": "custom-fields.delete",
        "summary": "Delete a custom field",
        "description": "Soft-deletes a custom field. It disappears from forms and records, and stops being required.",
        "tags": ["custom-fields"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "CUSTOM_FIELDS.DELETE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFieldsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomFieldsDeleteOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/comments/list": {
      "get": {
        "operationId": "comments.list.get",
        "summary": "List comments on a record",
        "description": "Returns the comments on one record, oldest first. Archived comments are left out unless asked for.",
        "tags": ["comments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "recordType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "asset-category",
                "asset",
                "asset-type",
                "client",
                "client-contact",
                "location",
                "maintenance-job",
                "project",
                "manufacturer"
              ],
              "description": "The kind of record: `asset-category` (an asset category), `asset` (an asset (one unit, or one bulk lot)), `asset-type` (an asset type (a catalogue entry)), `client` (a client), `client-contact` (a person at a client), `location` (a location), `maintenance-job` (a maintenance job (a fault or piece of work on assets)), `project` (a project (an event, show or hire)), `manufacturer` (a manufacturer of assets)"
            },
            "description": "The kind of record: `asset-category` (an asset category), `asset` (an asset (one unit, or one bulk lot)), `asset-type` (an asset type (a catalogue entry)), `client` (a client), `client-contact` (a person at a client), `location` (a location), `maintenance-job` (a maintenance job (a fault or piece of work on assets)), `project` (a project (an event, show or hire)), `manufacturer` (a manufacturer of assets)"
          },
          {
            "name": "recordUuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the record"
            },
            "description": "UUID of the record"
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return archived comments",
              "type": "boolean"
            },
            "description": "Also return archived comments"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of comments per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of comments per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort comments by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt", "updatedAt"]
            },
            "description": "Field to sort comments by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "comments.list",
        "summary": "List comments on a record",
        "description": "Returns the comments on one record, oldest first. Archived comments are left out unless asked for.",
        "tags": ["comments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/comments/list-mine": {
      "get": {
        "operationId": "comments.list-mine.get",
        "summary": "List my comments",
        "description": "Returns comments assigned to the caller, written by them, or mentioning them, newest first, across every record they can see.",
        "tags": ["comments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "filter",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["assigned", "created", "mentioned"],
              "description": "Which of the caller's comments: `assigned` to them as a task, `created` by them, or `mentioned` them"
            },
            "description": "Which of the caller's comments: `assigned` to them as a task, `created` by them, or `mentioned` them"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "default": "open",
              "description": "Only open comments, only resolved ones, or both",
              "type": "string",
              "enum": ["open", "resolved", "all"]
            },
            "description": "Only open comments, only resolved ones, or both"
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return archived comments",
              "type": "boolean"
            },
            "description": "Also return archived comments"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of comments per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of comments per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort comments by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt", "updatedAt"]
            },
            "description": "Field to sort comments by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "comments.list-mine",
        "summary": "List my comments",
        "description": "Returns comments assigned to the caller, written by them, or mentioning them, newest first, across every record they can see.",
        "tags": ["comments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsListMineInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/comments/get": {
      "get": {
        "operationId": "comments.get.get",
        "summary": "Get a comment",
        "description": "Returns one comment, including archived ones.",
        "tags": ["comments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the comment"
            },
            "description": "UUID of the comment"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Comment"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "comments.get",
        "summary": "Get a comment",
        "description": "Returns one comment, including archived ones.",
        "tags": ["comments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Comment"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/comments/people": {
      "get": {
        "operationId": "comments.people.get",
        "summary": "List people to mention",
        "description": "Returns the organisation's members by name and UUID, for mentioning in or assigning a comment.",
        "tags": ["comments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return people whose name contains this text",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return people whose name contains this text"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommentsPeopleOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "comments.people",
        "summary": "List people to mention",
        "description": "Returns the organisation's members by name and UUID, for mentioning in or assigning a comment.",
        "tags": ["comments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsPeopleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommentsPeopleOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/comments/create": {
      "post": {
        "operationId": "comments.create",
        "summary": "Comment on a record",
        "description": "Adds a comment to a record, optionally assigning it to someone as a task and attaching files that have already been uploaded. Everyone mentioned, and the assignee, is emailed a link to it. Mentioning or assigning someone who cannot see the record is refused.",
        "tags": ["comments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Comment"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ATTACHMENT_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, PERSON_CANNOT_VIEW, PERSON_NOT_FOUND, RECORD_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/comments/update": {
      "post": {
        "operationId": "comments.update",
        "summary": "Edit a comment",
        "description": "Changes a comment's text, attachments or assignee. Only the author can change the text and attachments. People newly mentioned, and a new assignee, are emailed a link to it.",
        "tags": ["comments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Comment"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AUTHOR, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ATTACHMENT_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, PERSON_CANNOT_VIEW, PERSON_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/comments/resolve": {
      "post": {
        "operationId": "comments.resolve",
        "summary": "Resolve or reopen a comment",
        "description": "Marks a comment resolved, or reopens it. Its author and its assignee can always do this.",
        "tags": ["comments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsResolveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Comment"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/comments/archive": {
      "post": {
        "operationId": "comments.archive",
        "summary": "Archive or restore a comment",
        "description": "Archives a comment, hiding it from lists unless archived comments are asked for, or restores it. Its author can always do this.",
        "tags": ["comments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "COMMENTS.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentsArchiveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Comment"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/icons/list": {
      "get": {
        "operationId": "icons.list.get",
        "summary": "List uploaded icons",
        "description": "Returns the icons the organisation has uploaded. Any of them can be chosen for an asset category as `custom:<uuid>`, as can any Tabler icon as `tabler:<name>`.",
        "tags": ["icons"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_CATEGORIES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IconsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "icons.list",
        "summary": "List uploaded icons",
        "description": "Returns the icons the organisation has uploaded. Any of them can be chosen for an asset category as `custom:<uuid>`, as can any Tabler icon as `tabler:<name>`.",
        "tags": ["icons"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSET_CATEGORIES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IconsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IconsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/icons/create": {
      "post": {
        "operationId": "icons.create",
        "summary": "Upload an icon",
        "description": "Uploads an SVG, PNG or WebP image as an icon the organisation can choose for its asset categories. An organisation can have at most 200 icons.",
        "tags": ["icons"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSET_CATEGORIES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IconsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Icon"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LIMIT_REACHED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_IMAGE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/icons/delete": {
      "post": {
        "operationId": "icons.delete",
        "summary": "Delete an uploaded icon",
        "description": "Deletes an uploaded icon. Asset categories that were using it are left without an icon.",
        "tags": ["icons"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSET_CATEGORIES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IconsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IconsDeleteOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invitations/list": {
      "get": {
        "operationId": "invitations.list.get",
        "summary": "List pending invitations",
        "description": "Returns the invitations to join the organisation that have been sent and not yet accepted or revoked, including expired ones.",
        "tags": ["invitations"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_USERS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvitationsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "invitations.list",
        "summary": "List pending invitations",
        "description": "Returns the invitations to join the organisation that have been sent and not yet accepted or revoked, including expired ones.",
        "tags": ["invitations"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_USERS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvitationsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invitations/create": {
      "post": {
        "operationId": "invitations.create",
        "summary": "Invite someone by email",
        "description": "Emails a link that lets the recipient join the organisation with the given role, creating an account first if they need one. The link works once, for 14 days. An organisation can send at most 50 invitations in any 24 hours.",
        "tags": ["invitations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_USERS.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invitation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_INVITED, ALREADY_MEMBER, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: EMAIL_FAILED, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invitations/resend": {
      "post": {
        "operationId": "invitations.resend",
        "summary": "Resend an invitation",
        "description": "Sends the invitation email again with a new link, valid for another 14 days. Links in earlier emails stop working. An invitation can be sent at most 3 times.",
        "tags": ["invitations"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_USERS.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationsResendInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invitation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, SEND_LIMIT_REACHED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: EMAIL_FAILED, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invitations/revoke": {
      "post": {
        "operationId": "invitations.revoke",
        "summary": "Revoke an invitation",
        "description": "Cancels a pending invitation, so its link no longer works. Does not affect anyone who has already joined.",
        "tags": ["invitations"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_USERS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationsRevokeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvitationsRevokeOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/members/list": {
      "get": {
        "operationId": "members.list.get",
        "summary": "List members",
        "description": "Returns the organisation's members, with their role and whether they hold a licence. Removed members are included on request.",
        "tags": ["members"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_USERS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "includeRemoved",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return members who have been removed. Needs permission to view removed members",
              "type": "boolean"
            },
            "description": "Also return members who have been removed. Needs permission to view removed members"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MembersListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "members.list",
        "summary": "List members",
        "description": "Returns the organisation's members, with their role and whether they hold a licence. Removed members are included on request.",
        "tags": ["members"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_USERS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MembersListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/members/change-role": {
      "post": {
        "operationId": "members.change-role",
        "summary": "Change a member's role",
        "description": "Gives a member a different role. The organisation must keep at least one administrator, and the billing contact must stay an administrator.",
        "tags": ["members"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_USERS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersChangeRoleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Member"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: BILLING_CONTACT, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LAST_ADMINISTRATOR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/members/remove": {
      "post": {
        "operationId": "members.remove",
        "summary": "Remove a member",
        "description": "Removes a member from the organisation and frees their licence. Their history is kept, and they can be restored. Give `at` to remove them on a date instead, such as the end of their contract: they keep their access until then. You cannot remove yourself or the last administrator.",
        "tags": ["members"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_USERS.DELETE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Member"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: CANNOT_REMOVE_SELF, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LAST_ADMINISTRATOR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, NOT_IN_FUTURE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/members/restore": {
      "post": {
        "operationId": "members.restore",
        "summary": "Restore a removed member",
        "description": "Adds a removed member back to the organisation, with their previous role unless another is given. A licence is assigned if one is free.",
        "tags": ["members"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_USERS.RESTORE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersRestoreInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Member"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/members/cancel-removal": {
      "post": {
        "operationId": "members.cancel-removal",
        "summary": "Cancel a member's removal",
        "description": "Keeps a member who was set to be removed on a date, so they stay in the organisation.",
        "tags": ["members"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_USERS.DELETE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersCancelRemovalInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Member"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/members/get": {
      "get": {
        "operationId": "members.get.get",
        "summary": "Get a member",
        "description": "Returns one member, current or removed, with their role, job title, licence and when they joined.",
        "tags": ["members"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_USERS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "userUuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "The member's user UUID"
            },
            "description": "The member's user UUID"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberProfile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "members.get",
        "summary": "Get a member",
        "description": "Returns one member, current or removed, with their role, job title, licence and when they joined.",
        "tags": ["members"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_USERS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberProfile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/members/me": {
      "get": {
        "operationId": "members.me.get",
        "summary": "Who am I",
        "description": "Returns the member making the call (their name, email address, role and licence), the organisation it is in, and every permission they hold there. Any member can call it, whatever their role.",
        "tags": ["members"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": null,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MembersMeOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "members.me",
        "summary": "Who am I",
        "description": "Returns the member making the call (their name, email address, role and licence), the organisation it is in, and every permission they hold there. Any member can call it, whatever their role.",
        "tags": ["members"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": null,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersMeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MembersMeOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/members/update": {
      "post": {
        "operationId": "members.update",
        "summary": "Edit a member",
        "description": "Changes a member's job title in the organisation.",
        "tags": ["members"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_USERS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Member"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/licences/list": {
      "get": {
        "operationId": "licences.list.get",
        "summary": "List licences",
        "description": "Returns every licence the organisation has, whether it comes with the plan or is extra, and which member holds it. Members without a licence can't use the organisation.",
        "tags": ["licences"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_LICENCES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LicencesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "licences.list",
        "summary": "List licences",
        "description": "Returns every licence the organisation has, whether it comes with the plan or is extra, and which member holds it. Members without a licence can't use the organisation.",
        "tags": ["licences"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_LICENCES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicencesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LicencesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/licences/assign": {
      "post": {
        "operationId": "licences.assign",
        "summary": "Give a member a licence",
        "description": "Gives a free licence to a member who doesn't have one, so they can use the organisation. Licences that come with the plan are used first. Once given, a licence can't be taken back for a day.",
        "tags": ["licences"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_LICENCES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicencesAssignInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Licence"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, MEMBER_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_LICENSED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NO_LICENCES_LEFT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/licences/unassign": {
      "post": {
        "operationId": "licences.unassign",
        "summary": "Take back a licence",
        "description": "Takes a licence back from its member, so it is free to give to someone else. The member can't use the organisation until they have a licence again. A licence can't be taken back for a day after it was given.",
        "tags": ["licences"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_LICENCES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicencesUnassignInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Licence"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, RECENTLY_ASSIGNED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/files/list": {
      "get": {
        "operationId": "files.list.get",
        "summary": "List files",
        "description": "Returns the organisation's files and links, newest first unless asked otherwise, optionally in one category or matching a name. Can list the trash instead.",
        "tags": ["files"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATION_FILES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only files in this category. Omit for every category",
              "type": "string",
              "enum": [
                "INVOICES",
                "DOCUMENTS",
                "ASSET_THUMBNAILS",
                "RECEIPTS",
                "PROJECT_FILES",
                "ATTACHMENTS",
                "COMMENT_ATTACHMENTS",
                "SCAN_MEDIA",
                "CERTIFICATION_EVIDENCE",
                "CREW_APPLICATIONS",
                "AI_IMPORTS",
                "GENERATED_DOCUMENTS",
                "ISSUED_DOCUMENTS",
                "DATABASE_BACKUPS"
              ]
            },
            "description": "Only files in this category. Omit for every category"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only files whose name contains this text, ignoring case",
              "type": "string",
              "maxLength": 200
            },
            "description": "Only files whose name contains this text, ignoring case"
          },
          {
            "name": "trash",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "List the files in the trash instead of the live ones. Needs permission to delete files",
              "type": "boolean"
            },
            "description": "List the files in the trash instead of the live ones. Needs permission to delete files"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of files per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of files per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort files by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt", "name", "sizeBytes"]
            },
            "description": "Field to sort files by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FilesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "files.list",
        "summary": "List files",
        "description": "Returns the organisation's files and links, newest first unless asked otherwise, optionally in one category or matching a name. Can list the trash instead.",
        "tags": ["files"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATION_FILES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FilesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/files/rename": {
      "post": {
        "operationId": "files.rename",
        "summary": "Rename a file",
        "description": "Changes the display name of a file or link. Files in some categories, such as invoices, can't be renamed.",
        "tags": ["files"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesRenameInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationFile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_ALLOWED_IN_CATEGORY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/files/delete": {
      "post": {
        "operationId": "files.delete",
        "summary": "Move a file to the trash",
        "description": "Moves a file or link to the trash. It can be restored for 30 days, then it is deleted for good. Files in some categories, such as invoices, can't be deleted.",
        "tags": ["files"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATION_FILES.DELETE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationFile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_ALLOWED_IN_CATEGORY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/files/restore": {
      "post": {
        "operationId": "files.restore",
        "summary": "Restore a file from the trash",
        "description": "Takes a file or link out of the trash. It counts towards the plan's file allowances again, so it must fit them.",
        "tags": ["files"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.DELETE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesRestoreInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationFile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/files/add-link": {
      "post": {
        "operationId": "files.add-link",
        "summary": "Add a link",
        "description": "Adds a link to a web address to one of the organisation's file categories, such as a venue's tech spec. Links count towards the plan's file allowance.",
        "tags": ["files"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesAddLinkInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationFile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_ALLOWED_IN_CATEGORY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/files/start-upload": {
      "post": {
        "operationId": "files.start-upload",
        "summary": "Start uploading a file",
        "description": "Checks a file can be added to a category (its type and size, and the organisation's storage allowance) and returns a private URL to PUT its bytes to. Large files are sent in parts. The file appears once `files.finish-upload` is called. To add a file to a record, such as a location, use `attachments.start-upload` instead.",
        "tags": ["files"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesStartUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FilesStartUploadOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_ALLOWED_IN_CATEGORY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FILE_TOO_LARGE, FILE_TYPE_NOT_ACCEPTED, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/files/finish-upload": {
      "post": {
        "operationId": "files.finish-upload",
        "summary": "Finish uploading a file",
        "description": "Completes an upload begun with `files.start-upload` once its bytes have been sent, and adds the file to its category.",
        "tags": ["files"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATION_FILES.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesFinishUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationFile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, UPLOAD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, UPLOAD_INCOMPLETE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/roles/list": {
      "get": {
        "operationId": "roles.list.get",
        "summary": "List roles",
        "description": "Returns the organisation's roles - the built-in Administrator, Editor and Viewer, and its own custom roles - with the permissions each gives and how many members have it.",
        "tags": ["roles"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_PERMISSIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RolesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "roles.list",
        "summary": "List roles",
        "description": "Returns the organisation's roles - the built-in Administrator, Editor and Viewer, and its own custom roles - with the permissions each gives and how many members have it.",
        "tags": ["roles"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_PERMISSIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RolesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RolesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/roles/reorder": {
      "post": {
        "operationId": "roles.reorder",
        "summary": "Reorder custom roles",
        "description": "Sets the order custom roles are listed in, wherever roles are listed or chosen. Built-in roles always come first.",
        "tags": ["roles"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_PERMISSIONS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RolesReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RolesListOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/roles/create": {
      "post": {
        "operationId": "roles.create",
        "summary": "Create a custom role",
        "description": "Creates a role with the given permissions, which members can then be given.",
        "tags": ["roles"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_PERMISSIONS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RolesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Role"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/roles/update": {
      "post": {
        "operationId": "roles.update",
        "summary": "Update a custom role",
        "description": "Renames a custom role and replaces its permissions. Takes effect immediately for every member with the role. Built-in roles cannot be changed.",
        "tags": ["roles"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_PERMISSIONS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RolesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Role"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: BUILT_IN_ROLE, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/roles/delete": {
      "post": {
        "operationId": "roles.delete",
        "summary": "Delete a custom role",
        "description": "Deletes a custom role. Members must be moved to another role first. Built-in roles cannot be deleted.",
        "tags": ["roles"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_PERMISSIONS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RolesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RolesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, ROLE_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: BUILT_IN_ROLE, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/webhooks/list": {
      "get": {
        "operationId": "webhooks.list.get",
        "summary": "List webhooks",
        "description": "Returns the organisation's webhooks: where each sends events, which events, whether it is on, and how its latest event went.",
        "tags": ["webhooks"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WEBHOOKS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhooksListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "webhooks.list",
        "summary": "List webhooks",
        "description": "Returns the organisation's webhooks: where each sends events, which events, whether it is on, and how its latest event went.",
        "tags": ["webhooks"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WEBHOOKS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhooksListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhooksListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/webhooks/create": {
      "post": {
        "operationId": "webhooks.create",
        "summary": "Create a webhook",
        "description": "Makes a webhook: AdamRMS POSTs a signed JSON event to the address each time one of the chosen functions changes something, such as `clients.create`. Events are signed as Standard Webhooks describes (`webhook-id`, `webhook-timestamp` and `webhook-signature` headers), with the secret returned here, which is shown only once. Failed deliveries are retried for about three days. The webhook acts for the member who makes it: it is only sent events about records they can see, and every event type must be one they can see now.",
        "tags": ["webhooks"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WEBHOOKS.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhooksCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhooksCreateOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, EVENT_NOT_READABLE, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LIMIT_REACHED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, SECRETS_UNAVAILABLE, UNKNOWN_EVENT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/webhooks/update": {
      "post": {
        "operationId": "webhooks.update",
        "summary": "Edit a webhook",
        "description": "Changes a webhook's address, events or description, or turns it off or back on. Events waiting to be sent while it is off are not sent.",
        "tags": ["webhooks"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "WEBHOOKS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhooksUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, EVENT_NOT_READABLE, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, UNKNOWN_EVENT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/webhooks/delete": {
      "post": {
        "operationId": "webhooks.delete",
        "summary": "Delete a webhook",
        "description": "Deletes a webhook. Nothing more is sent to it, including events still waiting to be retried.",
        "tags": ["webhooks"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "WEBHOOKS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhooksDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhooksDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/webhooks/deliveries": {
      "get": {
        "operationId": "webhooks.deliveries.get",
        "summary": "List a webhook's deliveries",
        "description": "The events sent to a webhook in the last 30 days, newest first: each one's ID (`webhook-id`), type, whether it was delivered, how many attempts it took, the latest status code and error, and when it will next be tried.",
        "tags": ["webhooks"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WEBHOOKS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "The webhook's UUID"
            },
            "description": "The webhook's UUID"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of deliveries per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of deliveries per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort deliveries by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt"]
            },
            "description": "Field to sort deliveries by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhooksDeliveriesOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "webhooks.deliveries",
        "summary": "List a webhook's deliveries",
        "description": "The events sent to a webhook in the last 30 days, newest first: each one's ID (`webhook-id`), type, whether it was delivered, how many attempts it took, the latest status code and error, and when it will next be tried.",
        "tags": ["webhooks"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "WEBHOOKS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhooksDeliveriesInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhooksDeliveriesOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/join-codes/list": {
      "get": {
        "operationId": "join-codes.list.get",
        "summary": "List join codes",
        "description": "Returns the organisation's join codes, active or not, with the role and job title each one gives and how many people have joined with it.",
        "tags": ["join-codes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinCodesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "join-codes.list",
        "summary": "List join codes",
        "description": "Returns the organisation's join codes, active or not, with the role and job title each one gives and how many people have joined with it.",
        "tags": ["join-codes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JoinCodesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinCodesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/join-codes/create": {
      "post": {
        "operationId": "join-codes.create",
        "summary": "Create a join code",
        "description": "Creates a code that anyone can use - typed in, or as a link or QR code - to join the organisation with the given role and job title, creating an account first if they need one. Codes are unique across AdamRMS.",
        "tags": ["join-codes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JoinCodesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinCode"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED, ROLE_EXCEEDS_PERMISSIONS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: CODE_TAKEN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ADMINISTRATOR_ROLE, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/join-codes/update": {
      "post": {
        "operationId": "join-codes.update",
        "summary": "Edit a join code",
        "description": "Turns a join code on or off, or changes the role and job title it gives and its notes. An inactive code cannot be used to join. Changing the job title doesn't change it for people who already joined.",
        "tags": ["join-codes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JoinCodesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinCode"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED, ROLE_EXCEEDS_PERMISSIONS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ADMINISTRATOR_ROLE, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/join-codes/delete": {
      "post": {
        "operationId": "join-codes.delete",
        "summary": "Delete a join code",
        "description": "Deletes a join code. Anyone who already joined with it stays a member.",
        "tags": ["join-codes"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.DELETE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JoinCodesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinCodesDeleteOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/email-domains/list": {
      "get": {
        "operationId": "email-domains.list.get",
        "summary": "List auto-join email domains",
        "description": "Returns the email domains whose users can join the organisation, and the role each one gives.",
        "tags": ["email-domains"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailDomainsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "email-domains.list",
        "summary": "List auto-join email domains",
        "description": "Returns the email domains whose users can join the organisation, and the role each one gives.",
        "tags": ["email-domains"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailDomainsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailDomainsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/email-domains/create": {
      "post": {
        "operationId": "email-domains.create",
        "summary": "Add an auto-join email domain",
        "description": "Lets anyone with a verified email address at the domain join the organisation with the given role.",
        "tags": ["email-domains"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailDomainsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailDomain"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED, ROLE_EXCEEDS_PERMISSIONS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: DOMAIN_EXISTS, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ADMINISTRATOR_ROLE, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/email-domains/update": {
      "post": {
        "operationId": "email-domains.update",
        "summary": "Turn an auto-join email domain on or off",
        "description": "Activates or deactivates an email domain. While inactive, nobody can join through it.",
        "tags": ["email-domains"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailDomainsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailDomain"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED, ROLE_EXCEEDS_PERMISSIONS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/email-domains/delete": {
      "post": {
        "operationId": "email-domains.delete",
        "summary": "Remove an auto-join email domain",
        "description": "Removes an email domain. Anyone who already joined through it stays a member.",
        "tags": ["email-domains"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_JOIN_METHODS.DELETE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailDomainsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailDomainsDeleteOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/single-sign-on/get": {
      "get": {
        "operationId": "single-sign-on.get.get",
        "summary": "Get single sign-on settings",
        "description": "Returns the organisation's SAML single sign-on: the identity provider it trusts, whether members must use it, its email domains, and the details to enter in the identity provider.",
        "tags": ["single-sign-on"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SingleSignOn"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "single-sign-on.get",
        "summary": "Get single sign-on settings",
        "description": "Returns the organisation's SAML single sign-on: the identity provider it trusts, whether members must use it, its email domains, and the details to enter in the identity provider.",
        "tags": ["single-sign-on"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SingleSignOnGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SingleSignOn"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/single-sign-on/update": {
      "post": {
        "operationId": "single-sign-on.update",
        "summary": "Change single sign-on settings",
        "description": "Sets the identity provider, the role new members get, and whether single sign-on is on and required.",
        "tags": ["single-sign-on"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SingleSignOnUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SingleSignOn"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ADMINISTRATOR_ROLE, IDEMPOTENCY_KEY_REUSED, INVALID_CERTIFICATE, NOT_READY, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/single-sign-on/domains/add": {
      "post": {
        "operationId": "single-sign-on.domains.add",
        "summary": "Add a single sign-on email domain",
        "description": "Adds an email domain, and returns the DNS TXT record that proves the organisation owns it.",
        "tags": ["single-sign-on"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SingleSignOnDomainsAddInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SingleSignOnDomain"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: DOMAIN_EXISTS, DOMAIN_TAKEN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/single-sign-on/domains/verify": {
      "post": {
        "operationId": "single-sign-on.domains.verify",
        "summary": "Verify a single sign-on email domain",
        "description": "Looks up the domain's DNS TXT record. Once it holds the right value, single sign-on can sign in addresses at the domain.",
        "tags": ["single-sign-on"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SingleSignOnDomainsVerifyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SingleSignOnDomain"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: DOMAIN_TAKEN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, RECORD_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/single-sign-on/domains/remove": {
      "post": {
        "operationId": "single-sign-on.domains.remove",
        "summary": "Remove a single sign-on email domain",
        "description": "Removes an email domain. Single sign-on stops signing in addresses there. Members stay members.",
        "tags": ["single-sign-on"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SingleSignOnDomainsRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SingleSignOnDomainsRemoveOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/organisation-url/list": {
      "get": {
        "operationId": "organisation-url.list.get",
        "summary": "List the organisation's URLs",
        "description": "Returns the organisation's current URL slug and every former one. Former URLs keep redirecting to the current one.",
        "tags": ["organisation-url"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SUBSCRIPTION.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationUrlListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organisation-url.list",
        "summary": "List the organisation's URLs",
        "description": "Returns the organisation's current URL slug and every former one. Former URLs keep redirecting to the current one.",
        "tags": ["organisation-url"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SUBSCRIPTION.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationUrlListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationUrlListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/organisation-url/change": {
      "post": {
        "operationId": "organisation-url.change",
        "summary": "Change the organisation's URL",
        "description": "Changes the slug in the organisation's URL. The old URL keeps working, redirecting to the new one, and can be switched back to later.",
        "tags": ["organisation-url"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SUBSCRIPTION.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationUrlChangeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrganisationUrlChangeOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_SLUG, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/list": {
      "get": {
        "operationId": "apps.list.get",
        "summary": "List Apps",
        "description": "Returns the organisation's Apps, each with its newest version and its installation, if installed.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return Apps whose name or key contains this text",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return Apps whose name or key contains this text"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of Apps per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of Apps per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort Apps by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort Apps by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.list",
        "summary": "List Apps",
        "description": "Returns the organisation's Apps, each with its newest version and its installation, if installed.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/get": {
      "get": {
        "operationId": "apps.get.get",
        "summary": "Get an App",
        "description": "Returns an App with every version's manifest and handlers (not their code) and its installation.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the App"
            },
            "description": "UUID of the App"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.get",
        "summary": "Get an App",
        "description": "Returns an App with every version's manifest and handlers (not their code) and its installation.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/create": {
      "post": {
        "operationId": "apps.create",
        "summary": "Create an App",
        "description": "Creates an empty App. Add code with apps.versions.create, then a member installs it.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/App"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, KEY_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/update": {
      "post": {
        "operationId": "apps.update",
        "summary": "Update an App",
        "description": "Changes an App's name or description. Fields that are omitted are left unchanged.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/App"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/delete": {
      "post": {
        "operationId": "apps.delete",
        "summary": "Delete an App",
        "description": "Soft-deletes an App and its versions. An installed App must be uninstalled first.",
        "tags": ["apps"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "APPS.DELETE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsDeleteOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, INSTALLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/versions/create": {
      "post": {
        "operationId": "apps.versions.create",
        "summary": "Create an App version",
        "description": "Adds an immutable version of an App: a manifest and one ES module. The code is checked: it must parse, export at least one handler, have no imports, and call only `adamrms.*` functions the manifest lists, each of whose permissions the manifest also asks for. Creating a version changes nothing that is running; a member installs or upgrades to it.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.CREATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsVersionsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppVersion"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: FROM_MARKETPLACE, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, VERSION_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_CODE, INVALID_MANIFEST, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/versions/get": {
      "get": {
        "operationId": "apps.versions.get.get",
        "summary": "Get an App version",
        "description": "Returns one version of an App, including its code.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the version"
            },
            "description": "UUID of the version"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppVersion"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.versions.get",
        "summary": "Get an App version",
        "description": "Returns one version of an App, including its code.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsVersionsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppVersion"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/install": {
      "post": {
        "operationId": "apps.install",
        "summary": "Install an App",
        "description": "Installs a version of an App, approving the permissions, functions and hosts its manifest asks for. The installation gets its own bot member holding exactly those permissions, which never needs a licence. The organisation's plan limits how many Apps can be installed at once. Must be done by a person, not by AI code or another App.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.INSTALL",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsInstallInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppInstallation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, VERSION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_INSTALLED, FUNCTION_NAME_TAKEN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, TOO_MANY_BEFORE_HOOKS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_SETTINGS, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/upgrade": {
      "post": {
        "operationId": "apps.upgrade",
        "summary": "Upgrade an App",
        "description": "Moves an installation to another version of its App, approving that version's manifest in place of the old one. Must be done by a person, not by AI code or another App.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.INSTALL",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUpgradeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppInstallation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, VERSION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: FUNCTION_NAME_TAKEN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, TOO_MANY_BEFORE_HOOKS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_SETTINGS, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/uninstall": {
      "post": {
        "operationId": "apps.uninstall",
        "summary": "Uninstall an App",
        "description": "Removes an installation: its bot member leaves the organisation, and its secrets and storage are deleted. Its run log is kept.",
        "tags": ["apps"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "APPS.INSTALL",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUninstallInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUninstallOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/update-settings": {
      "post": {
        "operationId": "apps.update-settings",
        "summary": "Update an App's settings",
        "description": "Replaces an installation's setting values. They must match the settings its version declares.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.INSTALL",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUpdateSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppInstallation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_SETTINGS, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/set-secret": {
      "post": {
        "operationId": "apps.set-secret",
        "summary": "Set an App's secret",
        "description": "Sets or removes one of an installation's secrets. Values are encrypted, never returned, and never reach the App's code: the platform substitutes them into requests to the App's approved hosts. Must be done by a person, not by AI code or another App.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.INSTALL",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsSetSecretInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppInstallation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, SECRETS_UNAVAILABLE, UNKNOWN_SECRET",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/run": {
      "post": {
        "operationId": "apps.run",
        "summary": "Run an App's handler",
        "description": "Runs one of an installed App's handlers now, with the given input, and waits for it to finish (at most 30 seconds). The App acts as its bot member, so it can do only what its installation was approved for. Returns the run, with its result, console output and outbound requests.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.RUN",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsRunInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppRun"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, HANDLER_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INPUT_TOO_LARGE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/resume": {
      "post": {
        "operationId": "apps.resume",
        "summary": "Resume an App",
        "description": "Starts delivering hooks to an installation again after it was paused for failing too many times in a row. Events while it was paused are not delivered.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.INSTALL",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsResumeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppInstallation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_PAUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/set-hook-order": {
      "post": {
        "operationId": "apps.set-hook-order",
        "summary": "Set when an App's before hooks run",
        "description": "Sets where an installation's before hooks run among other Apps' on the same function: lower first, then the earliest installed. Each sees the call as the one before it left it.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.INSTALL",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsSetHookOrderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppInstallation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/runs/list": {
      "get": {
        "operationId": "apps.runs.list.get",
        "summary": "List App runs",
        "description": "Returns App runs, newest first unless another order is asked for, optionally for one installation.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "installationUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return runs of this installation",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only return runs of this installation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of runs per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of runs per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort runs by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt"]
            },
            "description": "Field to sort runs by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsRunsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.runs.list",
        "summary": "List App runs",
        "description": "Returns App runs, newest first unless another order is asked for, optionally for one installation.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsRunsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsRunsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/runs/get": {
      "get": {
        "operationId": "apps.runs.get.get",
        "summary": "Get an App run",
        "description": "Returns one run with its input, result, console output and outbound requests.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the run"
            },
            "description": "UUID of the run"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppRun"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.runs.get",
        "summary": "Get an App run",
        "description": "Returns one run with its input, result, console output and outbound requests.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsRunsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppRun"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/publish": {
      "post": {
        "operationId": "apps.publish",
        "summary": "Submit an App to the marketplace",
        "description": "Submits a version of one of the organisation's own Apps to the marketplace. AdamRMS reviews its code by hand before listing it; apps.get shows how the review went. Once listed, any organisation can add and install it, and sees the App's name, description, manifest and code. Each version can be submitted once. Must be done by a person, not by AI code or another App.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.PUBLISH",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsPublishInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppSubmission"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, VERSION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_SUBMITTED, FROM_MARKETPLACE, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/marketplace/list": {
      "get": {
        "operationId": "apps.marketplace.list.get",
        "summary": "List marketplace Apps",
        "description": "Returns the Apps other organisations publish that AdamRMS has reviewed and listed, each with its newest listed version and whether this organisation has added it.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return Apps whose name or key contains this text",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return Apps whose name or key contains this text"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of listings per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of listings per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort listings by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt"]
            },
            "description": "Field to sort listings by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsMarketplaceListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.marketplace.list",
        "summary": "List marketplace Apps",
        "description": "Returns the Apps other organisations publish that AdamRMS has reviewed and listed, each with its newest listed version and whether this organisation has added it.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsMarketplaceListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsMarketplaceListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/marketplace/get": {
      "get": {
        "operationId": "apps.marketplace.get.get",
        "summary": "Get a marketplace App",
        "description": "Returns a marketplace App with every listed version's manifest: the permissions, functions, hosts and triggers installing it asks an administrator to approve.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the listing"
            },
            "description": "UUID of the listing"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppListingDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.marketplace.get",
        "summary": "Get a marketplace App",
        "description": "Returns a marketplace App with every listed version's manifest: the permissions, functions, hosts and triggers installing it asks an administrator to approve.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "APPS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsMarketplaceGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppListingDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/marketplace/add": {
      "post": {
        "operationId": "apps.marketplace.add",
        "summary": "Add a marketplace App",
        "description": "Copies a marketplace App and its listed versions into the organisation, so it is installed, upgraded and run like the organisation's own Apps. Calling it again for an App already added brings in versions listed since, ready to upgrade to. Adding installs nothing. Must be done by a person, not by AI code or another App.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "APPS.INSTALL",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsMarketplaceAddInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/App"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, KEY_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/ui/asset-panel/render": {
      "get": {
        "operationId": "apps.ui.asset-panel.render.get",
        "summary": "Show Apps' panels for an asset",
        "description": "Runs the panel handler of every running App with a panel in this slot, in parallel, and returns the components each returned, for the page to show. A handler has a few seconds and can only call functions that read. Panels needing a permission the caller lacks are left out.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the asset whose page shows the panels"
            },
            "description": "UUID of the asset whose page shows the panels"
          },
          {
            "name": "installationUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only the panel of this installation, as listed by `apps.ui.asset-panel.list`. Omit for every App's",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only the panel of this installation, as listed by `apps.ui.asset-panel.list`. Omit for every App's"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelRenderOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.ui.asset-panel.render",
        "summary": "Show Apps' panels for an asset",
        "description": "Runs the panel handler of every running App with a panel in this slot, in parallel, and returns the components each returned, for the page to show. A handler has a few seconds and can only call functions that read. Panels needing a permission the caller lacks are left out.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUiAssetPanelRenderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelRenderOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/ui/asset-panel/list": {
      "get": {
        "operationId": "apps.ui.asset-panel.list.get",
        "summary": "List Apps' panels for assets",
        "description": "Returns which running Apps have a panel on asset pages, and its heading, without running them. Panels needing a permission the caller lacks are left out.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.ui.asset-panel.list",
        "summary": "List Apps' panels for assets",
        "description": "Returns which running Apps have a panel on asset pages, and its heading, without running them. Panels needing a permission the caller lacks are left out.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUiAssetPanelListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/ui/asset-panel/action": {
      "post": {
        "operationId": "apps.ui.asset-panel.action",
        "summary": "Use an App's panel on an asset",
        "description": "Runs one of a panel's actions, as a button or form in it does, then the panel's handler again. The App acts as its bot member, so the caller needs only to be able to see the panel. A button or form can instead call one of the App's own functions, which is called as the caller and needs that function's permission.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUiAssetPanelActionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelActionOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ACTION_NOT_FOUND, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ACTION_FAILED, IDEMPOTENCY_KEY_REUSED, INPUT_TOO_LARGE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/ui/client-panel/render": {
      "get": {
        "operationId": "apps.ui.client-panel.render.get",
        "summary": "Show Apps' panels for a client",
        "description": "Runs the panel handler of every running App with a panel in this slot, in parallel, and returns the components each returned, for the page to show. A handler has a few seconds and can only call functions that read. Panels needing a permission the caller lacks are left out.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "clientUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the client whose page shows the panels"
            },
            "description": "UUID of the client whose page shows the panels"
          },
          {
            "name": "installationUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only the panel of this installation, as listed by `its installation`. Omit for every App's",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only the panel of this installation, as listed by `its installation`. Omit for every App's"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelRenderOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.ui.client-panel.render",
        "summary": "Show Apps' panels for a client",
        "description": "Runs the panel handler of every running App with a panel in this slot, in parallel, and returns the components each returned, for the page to show. A handler has a few seconds and can only call functions that read. Panels needing a permission the caller lacks are left out.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUiClientPanelRenderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelRenderOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/ui/client-panel/action": {
      "post": {
        "operationId": "apps.ui.client-panel.action",
        "summary": "Use an App's panel on a client",
        "description": "Runs one of a panel's actions, as a button or form in it does, then the panel's handler again. The App acts as its bot member, so the caller needs only to be able to see the panel. A button or form can instead call one of the App's own functions, which is called as the caller and needs that function's permission.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CLIENTS.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUiClientPanelActionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelActionOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ACTION_NOT_FOUND, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ACTION_FAILED, IDEMPOTENCY_KEY_REUSED, INPUT_TOO_LARGE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/ui/project-finance-panel/render": {
      "get": {
        "operationId": "apps.ui.project-finance-panel.render.get",
        "summary": "Show Apps' panels on a project's Finance tab",
        "description": "Runs the panel handler of every running App with a panel in this slot, in parallel, and returns the components each returned, for the page to show. A handler has a few seconds and can only call functions that read. Panels needing a permission the caller lacks are left out.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project whose page shows the panels"
            },
            "description": "UUID of the project whose page shows the panels"
          },
          {
            "name": "installationUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only the panel of this installation, as listed by `its installation`. Omit for every App's",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only the panel of this installation, as listed by `its installation`. Omit for every App's"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelRenderOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "apps.ui.project-finance-panel.render",
        "summary": "Show Apps' panels on a project's Finance tab",
        "description": "Runs the panel handler of every running App with a panel in this slot, in parallel, and returns the components each returned, for the page to show. A handler has a few seconds and can only call functions that read. Panels needing a permission the caller lacks are left out.",
        "tags": ["apps"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUiProjectFinancePanelRenderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelRenderOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/apps/ui/project-finance-panel/action": {
      "post": {
        "operationId": "apps.ui.project-finance-panel.action",
        "summary": "Use an App's panel on a project's Finance tab",
        "description": "Runs one of a panel's actions, as a button or form in it does, then the panel's handler again. The App acts as its bot member, so the caller needs only to be able to see the panel. A button or form can instead call one of the App's own functions, which is called as the caller and needs that function's permission.",
        "tags": ["apps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "INVOICES.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppsUiProjectFinancePanelActionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsUiAssetPanelActionOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, HUMAN_REQUIRED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ACTION_NOT_FOUND, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ACTION_FAILED, IDEMPOTENCY_KEY_REUSED, INPUT_TOO_LARGE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/legacy-import/status": {
      "get": {
        "operationId": "legacy-import.status.get",
        "summary": "Get import status",
        "description": "Returns which business in the previous version of AdamRMS the organisation imports from, the run in progress and the last one, and how many records are waiting to import.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "preflight",
            "in": "query",
            "required": false,
            "schema": {
              "default": true,
              "description": "Count the records waiting in the previous version. Reads its database, so it is slower",
              "type": "boolean"
            },
            "description": "Count the records waiting in the previous version. Reads its database, so it is slower"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportStatusOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "legacy-import.status",
        "summary": "Get import status",
        "description": "Returns which business in the previous version of AdamRMS the organisation imports from, the run in progress and the last one, and how many records are waiting to import.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyImportStatusInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportStatusOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/legacy-import/runs/list": {
      "get": {
        "operationId": "legacy-import.runs.list.get",
        "summary": "List import runs",
        "description": "Lists the organisation's imports from the previous version of AdamRMS, newest first.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of runs per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of runs per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "startedAt",
              "description": "Field to sort runs by. Defaults to `startedAt`",
              "type": "string",
              "enum": ["startedAt"]
            },
            "description": "Field to sort runs by. Defaults to `startedAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportRunsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "legacy-import.runs.list",
        "summary": "List import runs",
        "description": "Lists the organisation's imports from the previous version of AdamRMS, newest first.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyImportRunsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportRunsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/legacy-import/runs/get": {
      "get": {
        "operationId": "legacy-import.runs.get.get",
        "summary": "Get an import run",
        "description": "Returns one import run, with the records it couldn't import.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the run"
            },
            "description": "UUID of the run"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportRunsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "legacy-import.runs.get",
        "summary": "Get an import run",
        "description": "Returns one import run, with the records it couldn't import.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyImportRunsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportRunsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/legacy-import/start": {
      "post": {
        "operationId": "legacy-import.start",
        "summary": "Run an import",
        "description": "Starts importing from the connected business in the previous version of AdamRMS. Records already imported are only changed if they changed there since. Records made here are never touched. Refused while another run is in progress, or if the person who connected the business can no longer migrate it.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyImportStartInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportRun"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_AVAILABLE, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_RUNNING, DIFFERENT_INSTANCE, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LINK_INVALID, MOVED, NOT_CONNECTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/legacy-import/cancel": {
      "post": {
        "operationId": "legacy-import.cancel",
        "summary": "Cancel an import",
        "description": "Stops the run in progress before its next step. What it has imported so far stays, and the next run carries on from there.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyImportCancelInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportRun"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_RUNNING",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/legacy-import/disconnect": {
      "post": {
        "operationId": "legacy-import.disconnect",
        "summary": "Disconnect the previous version",
        "description": "Disconnects the business in the previous version of AdamRMS. Imported records stay, and connecting the same business again carries on where the last run stopped. Refused while a run is in progress.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyImportDisconnectInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportDisconnectOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_RUNNING, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_CONNECTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/legacy-import/finish": {
      "post": {
        "operationId": "legacy-import.finish",
        "summary": "Finish moving",
        "description": "Finishes moving from the previous version of AdamRMS. The business there is suspended, and its members are sent here when they sign in. No more imports run, and every imported member is emailed once to say the organisation has moved. Run an import first: this is refused unless the last one completed, and while one is in progress.",
        "tags": ["legacy-import"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyImportFinishInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegacyImportFinishOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_AVAILABLE, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_RUNNING, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LEGACY_REFUSED, LINK_INVALID, MOVED, NOT_CONNECTED, NOT_IMPORTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/location-barcodes/list": {
      "get": {
        "operationId": "location-barcodes.list.get",
        "summary": "List a location's barcodes",
        "description": "Returns the value printed for a location (its UUID) and any other barcodes it answers to, such as labels from the previous version of AdamRMS.",
        "tags": ["location-barcodes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LOCATIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "locationUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the location"
            },
            "description": "UUID of the location"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationBarcodesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "location-barcodes.list",
        "summary": "List a location's barcodes",
        "description": "Returns the value printed for a location (its UUID) and any other barcodes it answers to, such as labels from the previous version of AdamRMS.",
        "tags": ["location-barcodes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "LOCATIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationBarcodesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationBarcodesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/location-barcodes/add": {
      "post": {
        "operationId": "location-barcodes.add",
        "summary": "Add a barcode to a location",
        "description": "Adds a barcode a location answers to when scanned, such as an existing shelf label. A barcode can belong to only one location or asset.",
        "tags": ["location-barcodes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "LOCATIONS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationBarcodesAddInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationBarcode"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, VALUE_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/location-barcodes/remove": {
      "post": {
        "operationId": "location-barcodes.remove",
        "summary": "Remove a barcode from a location",
        "description": "Removes one of a location's extra barcodes. The location still answers to its own UUID.",
        "tags": ["location-barcodes"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "LOCATIONS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationBarcodesRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LocationBarcodesRemoveOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/barcodes/resolve": {
      "get": {
        "operationId": "barcodes.resolve.get",
        "summary": "Find what a barcode belongs to",
        "description": "Returns the asset or location a scanned barcode belongs to (ignoring case), or that nothing has it.",
        "tags": ["barcodes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "value",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "description": "A barcode as scanned or typed"
            },
            "description": "A barcode as scanned or typed"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BarcodesResolveOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "barcodes.resolve",
        "summary": "Find what a barcode belongs to",
        "description": "Returns the asset or location a scanned barcode belongs to (ignoring case), or that nothing has it.",
        "tags": ["barcodes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodesResolveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BarcodesResolveOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-sessions/start": {
      "post": {
        "operationId": "scan-sessions.start",
        "summary": "Start scanning",
        "description": "Starts a scan session into a location, a case, a stock check of a location, a project, or nothing. Moving assets as they are scanned needs permission to edit assets. Scanning for a project (to prep, send out or check back its assets) needs permission to change what's on projects. Where the organisation makes filming or photos compulsory, the session has them whatever is asked.",
        "tags": ["scan-sessions"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanSessionsStartInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSession"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CASE_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, LOCATION_NOT_FOUND, PROJECT_NOT_FOUND, REJECTED_BY_APP, TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-sessions/get": {
      "get": {
        "operationId": "scan-sessions.get.get",
        "summary": "Get a scan session",
        "description": "Returns a scan session and what it scans into.",
        "tags": ["scan-sessions"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the session"
            },
            "description": "UUID of the session"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSession"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "scan-sessions.get",
        "summary": "Get a scan session",
        "description": "Returns a scan session and what it scans into.",
        "tags": ["scan-sessions"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanSessionsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSession"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-sessions/verify-target": {
      "post": {
        "operationId": "scan-sessions.verify-target",
        "summary": "Verify where you are scanning",
        "description": "Marks your open session's target as verified when the barcode scanned belongs to it, so later scans in it count as at a verified location. Returns whether it matched.",
        "tags": ["scan-sessions"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanSessionsVerifyTargetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSessionsVerifyTargetOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, SESSION_ENDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-sessions/end": {
      "post": {
        "operationId": "scan-sessions.end",
        "summary": "Stop scanning",
        "description": "Ends your scan session, so nothing more can be scanned into it. Ending one that has already ended does nothing.",
        "tags": ["scan-sessions"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanSessionsEndInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSession"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-sessions/list": {
      "get": {
        "operationId": "scan-sessions.list.get",
        "summary": "List scan sessions",
        "description": "Lists scan sessions, newest first, optionally only those into one location or of one kind (such as stock checks).",
        "tags": ["scan-sessions"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "locationUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only sessions into this location",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only sessions into this location"
          },
          {
            "name": "targetKind",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only sessions of this kind, for example STOCK_CHECK",
              "type": "string",
              "enum": ["LOCATION", "CASE", "STOCK_CHECK", "NONE", "PROJECT"]
            },
            "description": "Only sessions of this kind, for example STOCK_CHECK"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of sessions per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of sessions per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "startedAt",
              "description": "Field to sort sessions by. Defaults to `startedAt`",
              "type": "string",
              "enum": ["startedAt"]
            },
            "description": "Field to sort sessions by. Defaults to `startedAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSessionsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "scan-sessions.list",
        "summary": "List scan sessions",
        "description": "Lists scan sessions, newest first, optionally only those into one location or of one kind (such as stock checks).",
        "tags": ["scan-sessions"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanSessionsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSessionsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scans/record": {
      "post": {
        "operationId": "scans.record",
        "summary": "Record a scan",
        "description": "Records a scanned barcode in your open session. An asset's barcode records a sighting, and in a MOVE session moves it to the target. In a PROJECT session it also marks the asset prepped, sent out or back on the project, and says what it did in `project`. A unit already in the session, an unknown barcode or a location's barcode records nothing and says so in `outcome`.",
        "tags": ["scans"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScansRecordInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScansRecordOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, SESSION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, SESSION_ENDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scans/update": {
      "post": {
        "operationId": "scans.update",
        "summary": "Rate a scan's condition or quantity",
        "description": "Sets how many of a lot a scan saw, and the asset's condition with a note. You can change your own scans; changing anyone's needs permission to edit assets.",
        "tags": ["scans"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScansUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Scan"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scans/list": {
      "get": {
        "operationId": "scans.list.get",
        "summary": "List scans",
        "description": "Lists scans, newest first, with their condition photos and footage. Filter by asset, location, session or condition.",
        "tags": ["scans"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only scans of this asset",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only scans of this asset"
          },
          {
            "name": "locationUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only scans at this location",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only scans at this location"
          },
          {
            "name": "sessionUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only scans in this session",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only scans in this session"
          },
          {
            "name": "condition",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only scans rated this condition",
              "type": "string",
              "enum": ["GOOD", "WORN", "DAMAGED"]
            },
            "description": "Only scans rated this condition"
          },
          {
            "name": "withPhotos",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Only scans with a condition photo",
              "type": "boolean"
            },
            "description": "Only scans with a condition photo"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of scans per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of scans per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "scannedAt",
              "description": "Field to sort scans by. Defaults to `scannedAt`",
              "type": "string",
              "enum": ["scannedAt"]
            },
            "description": "Field to sort scans by. Defaults to `scannedAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScansListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "scans.list",
        "summary": "List scans",
        "description": "Lists scans, newest first, with their condition photos and footage. Filter by asset, location, session or condition.",
        "tags": ["scans"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScansListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScansListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scans/latest": {
      "get": {
        "operationId": "scans.latest.get",
        "summary": "Where an asset was last seen",
        "description": "Returns an asset's latest scan made with a camera or scanner. Typed barcodes don't count.",
        "tags": ["scans"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the asset"
            },
            "description": "UUID of the asset"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScansLatestOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "scans.latest",
        "summary": "Where an asset was last seen",
        "description": "Returns an asset's latest scan made with a camera or scanner. Typed barcodes don't count.",
        "tags": ["scans"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScansLatestInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScansLatestOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-media/start-upload": {
      "post": {
        "operationId": "scan-media.start-upload",
        "summary": "Start uploading a scan's photo or footage",
        "description": "Checks a condition photo or footage can be added to one of your scans, and returns a private URL to PUT its bytes to. Footage is only for scans in a filmed session, one clip each. The file is added once `scan-media.finish-upload` is called.",
        "tags": ["scan-media"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanMediaStartUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanMediaStartUploadOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_FILMED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FILE_TOO_LARGE, IDEMPOTENCY_KEY_REUSED, NOT_FILMED, REJECTED_BY_APP, TOO_MANY_PHOTOS, WRONG_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-media/finish-upload": {
      "post": {
        "operationId": "scan-media.finish-upload",
        "summary": "Finish uploading a scan's photo or footage",
        "description": "Completes an upload begun with `scan-media.start-upload` and adds the photo or footage to the scan. Footage is kept for as long as the organisation's settings say; photos are kept until removed.",
        "tags": ["scan-media"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanMediaFinishUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Scan"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, UPLOAD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_FILMED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, NOT_FILMED, REJECTED_BY_APP, TOO_MANY_PHOTOS, UPLOAD_INCOMPLETE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-photos/remove": {
      "post": {
        "operationId": "scan-photos.remove",
        "summary": "Remove a condition photo",
        "description": "Takes a condition photo off its scan. The image goes to the trash, where it waits 30 days.",
        "tags": ["scan-photos"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanPhotosRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanPhotosRemoveOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/stock-checks/result": {
      "get": {
        "operationId": "stock-checks.result.get",
        "summary": "Get a stock check's result",
        "description": "Compares what a stock check session scanned with what is stored at its location: what was found, what is missing and what was there but shouldn't be. Assets inside a scanned case count as found.",
        "tags": ["stock-checks"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the session"
            },
            "description": "UUID of the session"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StockChecksResultOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "stock-checks.result",
        "summary": "Get a stock check's result",
        "description": "Compares what a stock check session scanned with what is stored at its location: what was found, what is missing and what was there but shouldn't be. Assets inside a scanned case count as found.",
        "tags": ["stock-checks"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockChecksResultInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StockChecksResultOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-presets/list": {
      "get": {
        "operationId": "scan-presets.list.get",
        "summary": "List scanner presets",
        "description": "Returns the organisation's saved ways to start the scanner.",
        "tags": ["scan-presets"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.SCAN",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanPresetsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "scan-presets.list",
        "summary": "List scanner presets",
        "description": "Returns the organisation's saved ways to start the scanner.",
        "tags": ["scan-presets"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.SCAN",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanPresetsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanPresetsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-presets/create": {
      "post": {
        "operationId": "scan-presets.create",
        "summary": "Create a scanner preset",
        "description": "Saves a way to start the scanner, such as 'Returns into the warehouse, with photos', for everyone in the organisation.",
        "tags": ["scan-presets"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanPresetsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanPreset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CASE_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, LOCATION_NOT_FOUND, REJECTED_BY_APP, TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-presets/update": {
      "post": {
        "operationId": "scan-presets.update",
        "summary": "Update a scanner preset",
        "description": "Replaces a scanner preset's name and settings.",
        "tags": ["scan-presets"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanPresetsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanPreset"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CASE_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, LOCATION_NOT_FOUND, REJECTED_BY_APP, TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-presets/delete": {
      "post": {
        "operationId": "scan-presets.delete",
        "summary": "Delete a scanner preset",
        "description": "Deletes a scanner preset. Scans made with it are kept.",
        "tags": ["scan-presets"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ASSETS.SCAN",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanPresetsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanPresetsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-settings/get": {
      "get": {
        "operationId": "scan-settings.get.get",
        "summary": "Get scanner settings",
        "description": "Returns whether scans are filmed and photographed, and how long footage is kept.",
        "tags": ["scan-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "scan-settings.get",
        "summary": "Get scanner settings",
        "description": "Returns whether scans are filmed and photographed, and how long footage is kept.",
        "tags": ["scan-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ASSETS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanSettingsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/scan-settings/update": {
      "post": {
        "operationId": "scan-settings.update",
        "summary": "Update scanner settings",
        "description": "Changes whether scans are filmed and photographed (off, on by default, or compulsory) and how long footage is kept. A new retention period applies to footage recorded from then on.",
        "tags": ["scan-settings"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScanSettings"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-statuses/list": {
      "get": {
        "operationId": "maintenance-statuses.list.get",
        "summary": "List maintenance job statuses",
        "description": "Returns the organisation's maintenance job statuses, such as 'Received' and 'Closed', in the order they're arranged.",
        "tags": ["maintenance-statuses"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of statuses per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of statuses per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "position",
              "description": "Field to sort statuses by. Defaults to `position`",
              "type": "string",
              "enum": ["position", "name"]
            },
            "description": "Field to sort statuses by. Defaults to `position`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceStatusesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "maintenance-statuses.list",
        "summary": "List maintenance job statuses",
        "description": "Returns the organisation's maintenance job statuses, such as 'Received' and 'Closed', in the order they're arranged.",
        "tags": ["maintenance-statuses"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceStatusesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceStatusesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-statuses/create": {
      "post": {
        "operationId": "maintenance-statuses.create",
        "summary": "Create a maintenance job status",
        "description": "Adds a status. An open status goes after the other open ones, a closed one at the end. Names are unique, ignoring case.",
        "tags": ["maintenance-statuses"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceStatusesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceStatus"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-statuses/update": {
      "post": {
        "operationId": "maintenance-statuses.update",
        "summary": "Update a maintenance job status",
        "description": "Renames a status, or makes it open or closed. Jobs already in it open or close with it. The last open status can't be closed.",
        "tags": ["maintenance-statuses"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceStatusesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceStatus"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, LAST_OPEN, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-statuses/reorder": {
      "post": {
        "operationId": "maintenance-statuses.reorder",
        "summary": "Reorder a maintenance job status",
        "description": "Moves a status to a new position and renumbers the rest.",
        "tags": ["maintenance-statuses"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceStatusesReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceStatus"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-statuses/delete": {
      "post": {
        "operationId": "maintenance-statuses.delete",
        "summary": "Delete a maintenance job status",
        "description": "Deletes a status. If any job uses it, `replacementUUID` is required and those jobs move to it. The last open status can't be deleted.",
        "tags": ["maintenance-statuses"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceStatusesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceStatusesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, LAST_OPEN, REJECTED_BY_APP, REPLACEMENT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-priorities/list": {
      "get": {
        "operationId": "maintenance-priorities.list.get",
        "summary": "List maintenance job priorities",
        "description": "Returns the organisation's maintenance job priorities, most urgent first unless another sort is asked for.",
        "tags": ["maintenance-priorities"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of priorities per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of priorities per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "position",
              "description": "Field to sort priorities by. Defaults to `position`",
              "type": "string",
              "enum": ["position", "name"]
            },
            "description": "Field to sort priorities by. Defaults to `position`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenancePrioritiesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "maintenance-priorities.list",
        "summary": "List maintenance job priorities",
        "description": "Returns the organisation's maintenance job priorities, most urgent first unless another sort is asked for.",
        "tags": ["maintenance-priorities"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenancePrioritiesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenancePrioritiesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-priorities/create": {
      "post": {
        "operationId": "maintenance-priorities.create",
        "summary": "Create a maintenance job priority",
        "description": "Adds a priority at the end of the list (the least urgent). Names are unique, ignoring case.",
        "tags": ["maintenance-priorities"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenancePrioritiesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenancePriority"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-priorities/update": {
      "post": {
        "operationId": "maintenance-priorities.update",
        "summary": "Update a maintenance job priority",
        "description": "Renames a priority, changes its colour, or makes it the default for new jobs.",
        "tags": ["maintenance-priorities"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenancePrioritiesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenancePriority"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-priorities/reorder": {
      "post": {
        "operationId": "maintenance-priorities.reorder",
        "summary": "Reorder a maintenance job priority",
        "description": "Moves a priority to a new position (0 is the most urgent) and renumbers the rest.",
        "tags": ["maintenance-priorities"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenancePrioritiesReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenancePriority"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-priorities/delete": {
      "post": {
        "operationId": "maintenance-priorities.delete",
        "summary": "Delete a maintenance job priority",
        "description": "Deletes a priority. If any job uses it, `replacementUUID` is required and those jobs move to it. The last priority can't be deleted.",
        "tags": ["maintenance-priorities"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenancePrioritiesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceStatusesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, LAST_ONE, REJECTED_BY_APP, REPLACEMENT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/list": {
      "get": {
        "operationId": "maintenance-jobs.list.get",
        "summary": "List maintenance jobs",
        "description": "Returns maintenance jobs with their assets, open ones only unless `state` says otherwise. Filter by status, priority, assignee or asset, and search by title or number.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only jobs whose title contains this text, or whose number is this",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only jobs whose title contains this text, or whose number is this"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "default": "OPEN",
              "description": "`OPEN` (the default) for jobs in an open status, `CLOSED` for the rest, or `ALL`",
              "type": "string",
              "enum": ["OPEN", "CLOSED", "ALL"]
            },
            "description": "`OPEN` (the default) for jobs in an open status, `CLOSED` for the rest, or `ALL`"
          },
          {
            "name": "statusUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only jobs in this status",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only jobs in this status"
          },
          {
            "name": "priorityUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only jobs with this priority",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only jobs with this priority"
          },
          {
            "name": "assigneeUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only jobs assigned to this member",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only jobs assigned to this member"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only jobs that cover this asset",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only jobs that cover this asset"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of jobs per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of jobs per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "number",
              "description": "Field to sort jobs by. Defaults to `number`",
              "type": "string",
              "enum": [
                "number",
                "title",
                "priority",
                "dueAt",
                "createdAt",
                "updatedAt"
              ]
            },
            "description": "Field to sort jobs by. Defaults to `number`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJobsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "maintenance-jobs.list",
        "summary": "List maintenance jobs",
        "description": "Returns maintenance jobs with their assets, open ones only unless `state` says otherwise. Filter by status, priority, assignee or asset, and search by title or number.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJobsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/get": {
      "get": {
        "operationId": "maintenance-jobs.get.get",
        "summary": "Get a maintenance job",
        "description": "Returns one maintenance job, by UUID or by number.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": false,
            "schema": {
              "description": "UUID of the job. Give this or `number`",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUID of the job. Give this or `number`"
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "schema": {
              "description": "The job's number. Give this or `uuid`",
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "description": "The job's number. Give this or `uuid`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "maintenance-jobs.get",
        "summary": "Get a maintenance job",
        "description": "Returns one maintenance job, by UUID or by number.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/create": {
      "post": {
        "operationId": "maintenance-jobs.create",
        "summary": "Create a maintenance job",
        "description": "Records a fault or piece of work on one or more assets. It gets the next job number, the first open status and the default priority unless others are given. Flagging or blocking its assets needs its own permission. The assignee and watchers must be members.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MAINTENANCE_JOBS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, PERSON_NOT_FOUND, PRIORITY_NOT_FOUND, QUANTITY_TOO_HIGH, REJECTED_BY_APP, STATUS_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/update": {
      "post": {
        "operationId": "maintenance-jobs.update",
        "summary": "Update a maintenance job",
        "description": "Changes a job's details, status, priority, assignee, due date, cost, supplier or outcome. Moving it to a closed status closes it, and its flags and blocks stop applying. Changing whether it flags or blocks needs its own permission. Fields that are omitted are left unchanged.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MAINTENANCE_JOBS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: COST_ITEMISED, IDEMPOTENCY_KEY_REUSED, PERSON_NOT_FOUND, PRIORITY_NOT_FOUND, REJECTED_BY_APP, STATUS_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/set-asset": {
      "post": {
        "operationId": "maintenance-jobs.set-asset",
        "summary": "Add an asset to a maintenance job",
        "description": "Adds an asset to a job, or changes how many of it the job covers. `released` lifts the job's flag and block from the asset while the job stays open.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MAINTENANCE_JOBS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsSetAssetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, QUANTITY_TOO_HIGH, REJECTED_BY_APP, TOO_MANY_ASSETS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/remove-asset": {
      "post": {
        "operationId": "maintenance-jobs.remove-asset",
        "summary": "Remove an asset from a maintenance job",
        "description": "Takes an asset off a job. The asset itself isn't changed.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MAINTENANCE_JOBS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsRemoveAssetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_ON_JOB, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/watch": {
      "post": {
        "operationId": "maintenance-jobs.watch",
        "summary": "Watch or stop watching a maintenance job",
        "description": "Starts or stops a member watching a job. Watchers are emailed when it's commented on or its status changes. Anyone who can see the job can watch it themselves; changing someone else needs permission to edit the job.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsWatchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, PERSON_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/delete": {
      "post": {
        "operationId": "maintenance-jobs.delete",
        "summary": "Delete a maintenance job",
        "description": "Deletes a job. Its flags and blocks stop applying. Its number isn't reused.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "MAINTENANCE_JOBS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJobsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/set-costs": {
      "post": {
        "operationId": "maintenance-jobs.set-costs",
        "summary": "Itemise a maintenance job's cost",
        "description": "Sets what a job cost, item by item: parts, labour (in hours) and anything else. Replaces the list, and the job's cost becomes their total.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MAINTENANCE_JOBS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsSetCostsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/charge-to-project": {
      "post": {
        "operationId": "maintenance-jobs.charge-to-project",
        "summary": "Charge a maintenance job to a project",
        "description": "Adds a one-off line to a project charging the client for the job, such as a repair after a hire, and links the two. It charges what the job cost unless an amount is given. A job is charged to one project at a time. Needs permission to change the project's lines and see their prices.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MAINTENANCE_JOBS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsChargeToProjectInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_CHARGED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSETS_OFF, IDEMPOTENCY_KEY_REUSED, NO_AMOUNT, PROJECT_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/remove-charge": {
      "post": {
        "operationId": "maintenance-jobs.remove-charge",
        "summary": "Stop charging a maintenance job to a project",
        "description": "Takes the job's line off the project it's charged to. A line an issued invoice charges for stays: credit the invoice first.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MAINTENANCE_JOBS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsRemoveChargeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJob"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, LINE_INVOICED, NOT_CHARGED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance-jobs/chargeable-projects": {
      "get": {
        "operationId": "maintenance-jobs.chargeable-projects.get",
        "summary": "List projects to charge a maintenance job to",
        "description": "Returns the projects the job's assets have been on, most recent first, as the likely ones to charge for the work.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the job"
            },
            "description": "UUID of the job"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJobsChargeableProjectsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "maintenance-jobs.chargeable-projects",
        "summary": "List projects to charge a maintenance job to",
        "description": "Returns the projects the job's assets have been on, most recent first, as the likely ones to charge for the work.",
        "tags": ["maintenance-jobs"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceJobsChargeableProjectsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceJobsChargeableProjectsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/maintenance/asset-state": {
      "get": {
        "operationId": "maintenance.asset-state.get",
        "summary": "Get an asset's maintenance state",
        "description": "Returns the open maintenance jobs on an asset, how many of it they block from being booked, and whether any shows a warning on it.",
        "tags": ["maintenance"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the asset"
            },
            "description": "UUID of the asset"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceAssetStateOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "maintenance.asset-state",
        "summary": "Get an asset's maintenance state",
        "description": "Returns the open maintenance jobs on an asset, how many of it they block from being booked, and whether any shows a warning on it.",
        "tags": ["maintenance"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MAINTENANCE_JOBS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceAssetStateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceAssetStateOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-statuses/list": {
      "get": {
        "operationId": "project-statuses.list.get",
        "summary": "List project statuses",
        "description": "Returns the organisation's project statuses, such as 'Quote sent' and 'Returned', in the order they're arranged. Each has a stage, which decides what it does to stock.",
        "tags": ["project-statuses"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of statuses per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of statuses per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "position",
              "description": "Field to sort statuses by. Defaults to `position`",
              "type": "string",
              "enum": ["position", "name"]
            },
            "description": "Field to sort statuses by. Defaults to `position`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectStatusesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-statuses.list",
        "summary": "List project statuses",
        "description": "Returns the organisation's project statuses, such as 'Quote sent' and 'Returned', in the order they're arranged. Each has a stage, which decides what it does to stock.",
        "tags": ["project-statuses"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectStatusesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectStatusesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-statuses/create": {
      "post": {
        "operationId": "project-statuses.create",
        "summary": "Create a project status",
        "description": "Adds a status at the end of the list. Names are unique, ignoring case. The first status made is the default.",
        "tags": ["project-statuses"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectStatusesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectStatus"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-statuses/update": {
      "post": {
        "operationId": "project-statuses.update",
        "summary": "Update a project status",
        "description": "Renames a status, changes its stage, or makes it the default for new projects. Projects already in it move stage with it.",
        "tags": ["project-statuses"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectStatusesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectStatus"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-statuses/reorder": {
      "post": {
        "operationId": "project-statuses.reorder",
        "summary": "Reorder a project status",
        "description": "Moves a status to a new position and renumbers the rest.",
        "tags": ["project-statuses"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectStatusesReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectStatus"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-statuses/delete": {
      "post": {
        "operationId": "project-statuses.delete",
        "summary": "Delete a project status",
        "description": "Deletes a status. If any project uses it, including projects in trash, `replacementUUID` is required and those projects move to it. The last status can't be deleted.",
        "tags": ["project-statuses"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectStatusesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectStatusesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, LAST_ONE, REJECTED_BY_APP, REPLACEMENT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-types/list": {
      "get": {
        "operationId": "project-types.list.get",
        "summary": "List project types",
        "description": "Returns the organisation's project types, such as 'Dry hire', with the sections each one turns on.",
        "tags": ["project-types"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of types per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of types per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort types by. Defaults to `name`",
              "type": "string",
              "enum": ["name"]
            },
            "description": "Field to sort types by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTypesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-types.list",
        "summary": "List project types",
        "description": "Returns the organisation's project types, such as 'Dry hire', with the sections each one turns on.",
        "tags": ["project-types"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTypesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTypesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-types/create": {
      "post": {
        "operationId": "project-types.create",
        "summary": "Create a project type",
        "description": "Adds a type. Sections left out are on. Names are unique, ignoring case. The first type made is the default.",
        "tags": ["project-types"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTypesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectType"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-types/update": {
      "post": {
        "operationId": "project-types.update",
        "summary": "Update a project type",
        "description": "Renames a type, turns its sections on or off, or makes it the default for new projects. Turning a section off hides it on the type's projects, but keeps what's in it.",
        "tags": ["project-types"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTypesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectType"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-types/delete": {
      "post": {
        "operationId": "project-types.delete",
        "summary": "Delete a project type",
        "description": "Deletes a type. If any project uses it, including projects in trash, `replacementUUID` is required and those projects move to it. The last type can't be deleted.",
        "tags": ["project-types"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTypesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectStatusesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, LAST_ONE, REJECTED_BY_APP, REPLACEMENT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/projects/list": {
      "get": {
        "operationId": "projects.list.get",
        "summary": "List projects",
        "description": "Returns projects, active ones only unless `view` says otherwise. Filter by status, type, client, manager, folder, parent project or dates, and search by name or number. `deleted` lists the projects in trash instead.",
        "tags": ["projects"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects whose name contains this text, or whose number is this",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only projects whose name contains this text, or whose number is this"
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "default": "ACTIVE",
              "description": "`ACTIVE` (the default) for projects at the enquiry, provisional or confirmed stage, `FINISHED`, `LOST`, or `ALL`",
              "type": "string",
              "enum": ["ACTIVE", "FINISHED", "LOST", "ALL"]
            },
            "description": "`ACTIVE` (the default) for projects at the enquiry, provisional or confirmed stage, `FINISHED`, `LOST`, or `ALL`"
          },
          {
            "name": "statusUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects in this status",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only projects in this status"
          },
          {
            "name": "typeUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects of this type",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only projects of this type"
          },
          {
            "name": "clientUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects for this client",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only projects for this client"
          },
          {
            "name": "managerUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects managed by this member",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only projects managed by this member"
          },
          {
            "name": "parentUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only the sub-projects of this project",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only the sub-projects of this project"
          },
          {
            "name": "folderUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only the projects in this folder itself, not in folders inside it. null for the top-level projects in no folder",
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only the projects in this folder itself, not in folders inside it. null for the top-level projects in no folder"
          },
          {
            "name": "topLevel",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Only top-level projects, leaving sub-projects out",
              "type": "boolean"
            },
            "description": "Only top-level projects, leaving sub-projects out"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects whose out or event period ends on or after this",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Only projects whose out or event period ends on or after this"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only projects whose out or event period starts on or before this",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Only projects whose out or event period starts on or before this"
          },
          {
            "name": "deleted",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "true lists the projects in trash instead of the live ones. Needs permission to see deleted projects",
              "type": "boolean"
            },
            "description": "true lists the projects in trash instead of the live ones. Needs permission to see deleted projects"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of projects per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of projects per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "number",
              "description": "Field to sort projects by. Defaults to `number`",
              "type": "string",
              "enum": [
                "number",
                "name",
                "outStart",
                "eventStart",
                "createdAt",
                "updatedAt"
              ]
            },
            "description": "Field to sort projects by. Defaults to `number`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "projects.list",
        "summary": "List projects",
        "description": "Returns projects, active ones only unless `view` says otherwise. Filter by status, type, client, manager, folder, parent project or dates, and search by name or number. `deleted` lists the projects in trash instead.",
        "tags": ["projects"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/projects/get": {
      "get": {
        "operationId": "projects.get.get",
        "summary": "Get a project",
        "description": "Returns one project, by UUID or by number, with its sub-projects and the dates that apply to it.",
        "tags": ["projects"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": false,
            "schema": {
              "description": "UUID of the project. Give this or `number`",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUID of the project. Give this or `number`"
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "schema": {
              "description": "The project's number. Give this or `uuid`",
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "description": "The project's number. Give this or `uuid`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "projects.get",
        "summary": "Get a project",
        "description": "Returns one project, by UUID or by number, with its sub-projects and the dates that apply to it.",
        "tags": ["projects"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/projects/create": {
      "post": {
        "operationId": "projects.create",
        "summary": "Create a project",
        "description": "Creates a project, or a sub-project of another. It gets the next project number, and the default status and type unless others are given. You manage it unless someone else is named, and the manager follows it. It can start from a project template, which adds the template's lines, crew roles (as vacancies) and notes. The plan limits how many top-level projects can be active at once.",
        "tags": ["projects"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECTS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, CLIENT_PRICING_NOT_FOUND, CONTACT_NOT_FOUND, FOLDER_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, INVALID_DATES, PARENT_NOT_FOUND, PERSON_NOT_FOUND, REJECTED_BY_APP, STATUS_NOT_FOUND, TAX_RATE_NOT_FOUND, TEMPLATE_NOT_FOUND, TOO_DEEP, TYPE_NOT_FOUND, VENUE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/projects/update": {
      "post": {
        "operationId": "projects.update",
        "summary": "Update a project",
        "description": "Changes a project's details, status, type, manager, client, venue, folder or dates, or moves it under another project. Sub-projects that follow its status change with it. Fields that are omitted are left unchanged.",
        "tags": ["projects"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, CLIENT_PRICING_NOT_FOUND, CONTACT_NOT_FOUND, FOLDER_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, INVALID_DATES, PARENT_IS_DESCENDANT, PARENT_NOT_FOUND, PERSON_NOT_FOUND, REJECTED_BY_APP, STATUS_NOT_FOUND, TAX_RATE_NOT_FOUND, TOO_DEEP, TYPE_NOT_FOUND, VENUE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/projects/follow": {
      "post": {
        "operationId": "projects.follow",
        "summary": "Follow or stop following a project",
        "description": "Starts or stops a member following a project. Followers are emailed when it gets a comment or its status changes. Anyone who can see the project can follow it themselves; changing someone else needs permission to edit the project.",
        "tags": ["projects"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsFollowInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, PERSON_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/projects/delete": {
      "post": {
        "operationId": "projects.delete",
        "summary": "Move a project to trash",
        "description": "Moves a project and its sub-projects to trash. Projects in trash are kept for good, and can be restored. The number isn't reused.",
        "tags": ["projects"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PROJECTS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/projects/restore": {
      "post": {
        "operationId": "projects.restore",
        "summary": "Restore a project from trash",
        "description": "Brings a project back from trash, with the sub-projects that went with it. A sub-project whose parent is still in trash comes back as a top-level project.",
        "tags": ["projects"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECTS.RESTORE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsRestoreInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-notes/list": {
      "get": {
        "operationId": "project-notes.list.get",
        "summary": "List a project's notes",
        "description": "Returns the notes on a project, newest first.",
        "tags": ["project-notes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project"
            },
            "description": "UUID of the project"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of notes per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of notes per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort notes by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt", "title"]
            },
            "description": "Field to sort notes by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectNotesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-notes.list",
        "summary": "List a project's notes",
        "description": "Returns the notes on a project, newest first.",
        "tags": ["project-notes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectNotesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectNotesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/projects/history": {
      "get": {
        "operationId": "projects.history.get",
        "summary": "Read a project's history",
        "description": "Returns what's been changed on a project in the last 90 days, newest first: the project itself, and its lines, assets, crew, notes, quotes, invoices and payments. Each change says who made it and when. Changes to parts of the project the caller can't see are left out.",
        "tags": ["projects"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project"
            },
            "description": "UUID of the project"
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return changes made before this time: the nextBefore of the previous page",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Only return changes made before this time: the nextBefore of the previous page"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "description": "How many changes to return, 1 to 50",
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "description": "How many changes to return, 1 to 50"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsHistoryOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "projects.history",
        "summary": "Read a project's history",
        "description": "Returns what's been changed on a project in the last 90 days, newest first: the project itself, and its lines, assets, crew, notes, quotes, invoices and payments. Each change says who made it and when. Changes to parts of the project the caller can't see are left out.",
        "tags": ["projects"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsHistoryInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsHistoryOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-notes/create": {
      "post": {
        "operationId": "project-notes.create",
        "summary": "Add a note to a project",
        "description": "Adds a titled note, such as meeting notes or a plan, written in Markdown.",
        "tags": ["project-notes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectNotesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectNote"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-notes/update": {
      "post": {
        "operationId": "project-notes.update",
        "summary": "Update a project note",
        "description": "Changes a note's title or text.",
        "tags": ["project-notes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectNotesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectNote"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-notes/delete": {
      "post": {
        "operationId": "project-notes.delete",
        "summary": "Delete a project note",
        "description": "Deletes a note from a project.",
        "tags": ["project-notes"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PROJECTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectNotesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectNotesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-folders/list": {
      "get": {
        "operationId": "project-folders.list.get",
        "summary": "List project folders",
        "description": "Returns every folder projects are organised in, such as 'Weddings', with how many projects each holds.",
        "tags": ["project-folders"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectFoldersListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-folders.list",
        "summary": "List project folders",
        "description": "Returns every folder projects are organised in, such as 'Weddings', with how many projects each holds.",
        "tags": ["project-folders"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectFoldersListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectFoldersListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-folders/create": {
      "post": {
        "operationId": "project-folders.create",
        "summary": "Create a project folder",
        "description": "Adds a folder, at the top or inside another folder. Names are unique within a folder, ignoring case.",
        "tags": ["project-folders"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectFoldersCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectFolder"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, PARENT_NOT_FOUND, REJECTED_BY_APP, TOO_DEEP, TOO_MANY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-folders/update": {
      "post": {
        "operationId": "project-folders.update",
        "summary": "Update a project folder",
        "description": "Renames a folder, or moves it into another folder with everything in it.",
        "tags": ["project-folders"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectFoldersUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectFolder"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, PARENT_IS_INSIDE, PARENT_NOT_FOUND, REJECTED_BY_APP, TOO_DEEP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-folders/delete": {
      "post": {
        "operationId": "project-folders.delete",
        "summary": "Delete a project folder",
        "description": "Deletes a folder. The projects and folders in it move up to the folder it was in, so no project is deleted.",
        "tags": ["project-folders"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PROJECTS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectFoldersDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectFoldersDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspection-templates/list": {
      "get": {
        "operationId": "inspection-templates.list.get",
        "summary": "List inspection templates",
        "description": "Returns the organisation's inspection templates, such as PAT and LOLER, with their checklists and the asset types they apply to.",
        "tags": ["inspection-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetTypeUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only templates that apply to this asset type",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only templates that apply to this asset type"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of templates per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of templates per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort templates by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt"]
            },
            "description": "Field to sort templates by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionTemplatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "inspection-templates.list",
        "summary": "List inspection templates",
        "description": "Returns the organisation's inspection templates, such as PAT and LOLER, with their checklists and the asset types they apply to.",
        "tags": ["inspection-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionTemplatesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionTemplatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspection-templates/get": {
      "get": {
        "operationId": "inspection-templates.get.get",
        "summary": "Get an inspection template",
        "description": "Returns one inspection template with its checklist.",
        "tags": ["inspection-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the template"
            },
            "description": "UUID of the template"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "inspection-templates.get",
        "summary": "Get an inspection template",
        "description": "Returns one inspection template with its checklist.",
        "tags": ["inspection-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionTemplatesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspection-templates/create": {
      "post": {
        "operationId": "inspection-templates.create",
        "summary": "Create an inspection template",
        "description": "Creates a regular inspection, such as 'PAT, every 12 months', with its checklist and the asset types it applies to. Only individually tracked asset types can be inspected. Names are unique, ignoring case.",
        "tags": ["inspection-templates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionTemplatesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionTemplate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_TYPE_NOT_FOUND, BULK_ASSET_TYPE, IDEMPOTENCY_KEY_REUSED, INVALID_ITEM, ITEM_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspection-templates/update": {
      "post": {
        "operationId": "inspection-templates.update",
        "summary": "Update an inspection template",
        "description": "Changes a template's interval, what happens when assets are overdue, its checklist or its asset types. A new interval changes when every asset is next due. Fields that are omitted are left unchanged.",
        "tags": ["inspection-templates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionTemplatesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionTemplate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_TYPE_NOT_FOUND, BULK_ASSET_TYPE, IDEMPOTENCY_KEY_REUSED, INVALID_ITEM, ITEM_NOT_FOUND, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspection-templates/delete": {
      "post": {
        "operationId": "inspection-templates.delete",
        "summary": "Delete an inspection template",
        "description": "Deletes a template. Assets stop being due it, and overdue ones stop being flagged or blocked. Results already recorded are kept.",
        "tags": ["inspection-templates"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionTemplatesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionTemplatesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspections/record": {
      "post": {
        "operationId": "inspections.record",
        "summary": "Record an inspection",
        "description": "Records that an asset was inspected, with the checklist answers. A line fails when a reading is outside its limits, a yes or no isn't the expected answer, or a failing choice is picked, and that fails the inspection unless `passOverride` says otherwise. A failure opens a maintenance job that blocks the asset.",
        "tags": ["inspections"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "INSPECTIONS.RECORD",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionsRecordInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionResult"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, INVALID_ANSWER, MISSING_ANSWER, NOT_APPLICABLE, OVERRIDE_NOTE_REQUIRED, PERSON_NOT_FOUND, REJECTED_BY_APP, SCAN_NOT_FOUND, TEMPLATE_NOT_FOUND, TESTED_IN_FUTURE, UNKNOWN_ITEM",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspections/get": {
      "get": {
        "operationId": "inspections.get.get",
        "summary": "Get an inspection result",
        "description": "Returns one inspection result with its checklist answers, who tested it, and the job a failure opened.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the result"
            },
            "description": "UUID of the result"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "inspections.get",
        "summary": "Get an inspection result",
        "description": "Returns one inspection result with its checklist answers, who tested it, and the job a failure opened.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspections/list": {
      "get": {
        "operationId": "inspections.list.get",
        "summary": "List inspection results",
        "description": "Returns inspection results, newest first, for an asset, a template, or the whole organisation.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only results for this asset",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only results for this asset"
          },
          {
            "name": "templateUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only results of this template",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only results of this template"
          },
          {
            "name": "passed",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only passes (true) or only failures (false)",
              "type": "boolean"
            },
            "description": "Only passes (true) or only failures (false)"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of results per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of results per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "testedAt",
              "description": "Field to sort results by. Defaults to `testedAt`",
              "type": "string",
              "enum": ["testedAt"]
            },
            "description": "Field to sort results by. Defaults to `testedAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "inspections.list",
        "summary": "List inspection results",
        "description": "Returns inspection results, newest first, for an asset, a template, or the whole organisation.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspections/delete": {
      "post": {
        "operationId": "inspections.delete",
        "summary": "Delete an inspection result",
        "description": "Deletes a result recorded by mistake. The asset's due date goes back to what the result before it says. A job the failure opened is left as it is.",
        "tags": ["inspections"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "INSPECTIONS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspections/asset-status": {
      "get": {
        "operationId": "inspections.asset-status.get",
        "summary": "Get an asset's inspections",
        "description": "Returns each inspection that applies to an asset: its interval, its latest result, and when it's next due.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "assetUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the asset"
            },
            "description": "UUID of the asset"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsAssetStatusOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "inspections.asset-status",
        "summary": "Get an asset's inspections",
        "description": "Returns each inspection that applies to an asset: its interval, its latest result, and when it's next due.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionsAssetStatusInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsAssetStatusOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspections/due": {
      "get": {
        "operationId": "inspections.due.get",
        "summary": "List assets due an inspection",
        "description": "Returns assets that are overdue or due soon (by default, within 14 days), soonest first.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "templateUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only this inspection",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only this inspection"
          },
          {
            "name": "dueBefore",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only assets due before this time. Omit for 14 days from now",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Only assets due before this time. Omit for 14 days from now"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of assets due per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of assets due per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "dueAt",
              "description": "Field to sort assets due by. Defaults to `dueAt`",
              "type": "string",
              "enum": ["dueAt"]
            },
            "description": "Field to sort assets due by. Defaults to `dueAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsDueOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "inspections.due",
        "summary": "List assets due an inspection",
        "description": "Returns assets that are overdue or due soon (by default, within 14 days), soonest first.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionsDueInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsDueOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspections/return-checks": {
      "get": {
        "operationId": "inspections.return-checks.get",
        "summary": "List a project's return checks",
        "description": "Returns the assets on a project that have come back and are due an inspection that checks each asset on return, such as a PAT test. Each stays listed until it's inspected.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project. Its sub-projects' assets are included"
            },
            "description": "UUID of the project. Its sub-projects' assets are included"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsReturnChecksOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "inspections.return-checks",
        "summary": "List a project's return checks",
        "description": "Returns the assets on a project that have come back and are due an inspection that checks each asset on return, such as a PAT test. Each stays listed until it's inspected.",
        "tags": ["inspections"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INSPECTIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionsReturnChecksInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsReturnChecksOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/inspections/set-asset-override": {
      "post": {
        "operationId": "inspections.set-asset-override",
        "summary": "Set an asset's own inspection interval",
        "description": "Gives one asset its own interval for a template, such as 6 months for a cable that's used hard, or leaves it out of the template. Send neither to go back to the template's.",
        "tags": ["inspections"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ASSETS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectionsSetAssetOverrideInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InspectionsAssetStatusOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: ASSET_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, INTERVAL_UNIT_REQUIRED, REJECTED_BY_APP, TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/document-templates/list": {
      "get": {
        "operationId": "document-templates.list.get",
        "summary": "List document templates",
        "description": "Returns the organisation's document templates, optionally of one kind. A kind with none uses its built-in layout.",
        "tags": ["document-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return templates of this kind. What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)",
              "type": "string",
              "enum": [
                "INSPECTION_CERTIFICATE",
                "INVOICE",
                "QUOTE",
                "DELIVERY_NOTE",
                "PICKING_LIST",
                "RETURN_NOTE",
                "CREW_CALL_SHEET",
                "PROJECT_NOTES",
                "CLIENT_STATEMENT"
              ]
            },
            "description": "Only return templates of this kind. What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of document templates per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of document templates per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort document templates by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort document templates by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentTemplatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "document-templates.list",
        "summary": "List document templates",
        "description": "Returns the organisation's document templates, optionally of one kind. A kind with none uses its built-in layout.",
        "tags": ["document-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentTemplatesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentTemplatesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/document-templates/get": {
      "get": {
        "operationId": "document-templates.get.get",
        "summary": "Get a document template",
        "description": "Returns one document template, with its settings and HTML.",
        "tags": ["document-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the template"
            },
            "description": "UUID of the template"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "document-templates.get",
        "summary": "Get a document template",
        "description": "Returns one document template, with its settings and HTML.",
        "tags": ["document-templates"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentTemplatesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/document-templates/create": {
      "post": {
        "operationId": "document-templates.create",
        "summary": "Create a document template",
        "description": "Creates a template for one kind of document. Without HTML it uses the kind's built-in layout, adjusted by its settings. HTML that isn't valid Liquid is refused.",
        "tags": ["document-templates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentTemplatesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentTemplate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_TEMPLATE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/document-templates/update": {
      "post": {
        "operationId": "document-templates.update",
        "summary": "Update a document template",
        "description": "Changes a template's name, paper size, settings or HTML, or makes it its kind's default. Fields that are omitted are left unchanged. Documents already made are not changed.",
        "tags": ["document-templates"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentTemplatesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentTemplate"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_TEMPLATE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/document-templates/delete": {
      "post": {
        "operationId": "document-templates.delete",
        "summary": "Delete a document template",
        "description": "Soft-deletes a template. Documents already made from it are kept. If it was the default, the oldest remaining template of its kind becomes the default.",
        "tags": ["document-templates"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentTemplatesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentTemplatesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/documents/preview": {
      "get": {
        "operationId": "documents.preview.get",
        "summary": "Preview a document",
        "description": "Renders a saved or unsaved template as HTML, with sample data or a real record, exactly as its PDF would be. Reading a real record needs access to it, as reading it directly would.",
        "tags": ["documents"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "INSPECTION_CERTIFICATE",
                "INVOICE",
                "QUOTE",
                "DELIVERY_NOTE",
                "PICKING_LIST",
                "RETURN_NOTE",
                "CREW_CALL_SHEET",
                "PROJECT_NOTES",
                "CLIENT_STATEMENT"
              ],
              "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
            },
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          {
            "name": "templateUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "UUID of a saved template of this kind. Omit to preview `draft`, or the kind's default",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUID of a saved template of this kind. Omit to preview `draft`, or the kind's default"
          },
          {
            "name": "draft",
            "in": "query",
            "required": false,
            "schema": {
              "description": "An unsaved template to preview, as the editor has it. Ignored when `templateUUID` is given",
              "type": "object",
              "properties": {
                "paperSize": {
                  "type": "string",
                  "enum": ["A4", "LETTER"],
                  "description": "Paper size: `A4` (210 × 297 mm) or `LETTER` (8.5 × 11 in)"
                },
                "settings": {
                  "$ref": "#/components/schemas/DocumentTemplateSettings"
                },
                "html": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 200000
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Liquid HTML for the document's body, up to 200,000 characters. It reads the kind's data, such as `{{ organisation.name }}`, and the filters `money`, `date`, `datetime` and `mass`. It can't run JavaScript or load anything from the internet: images must be `data:` URLs. Null uses the kind's built-in layout, adjusted by the settings"
                }
              },
              "required": ["paperSize", "settings", "html"]
            },
            "description": "An unsaved template to preview, as the editor has it. Ignored when `templateUUID` is given"
          },
          {
            "name": "recordUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "UUID of a real record to preview with, such as an inspection result. Omit to use sample data",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUID of a real record to preview with, such as an inspection result. Omit to use sample data"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentsPreviewOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND, TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: INVALID_TEMPLATE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "documents.preview",
        "summary": "Preview a document",
        "description": "Renders a saved or unsaved template as HTML, with sample data or a real record, exactly as its PDF would be. Reading a real record needs access to it, as reading it directly would.",
        "tags": ["documents"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsPreviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentsPreviewOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND, TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: INVALID_TEMPLATE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/documents/create": {
      "post": {
        "operationId": "documents.create",
        "summary": "Make a document",
        "description": "Makes a PDF of one record, such as a certificate for an inspection result, from a template, and saves it in the organisation's files on what it is about. It reads the record through its own functions, so it needs access to the record too; for AI-written code and Apps those reads are allowed as part of this call. The file counts towards the storage allowance.",
        "tags": ["documents"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GeneratedDocument"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND, TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, INVALID_TEMPLATE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED, RENDER_FAILED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/documents/list": {
      "get": {
        "operationId": "documents.list.get",
        "summary": "List a record's documents",
        "description": "Returns the documents made for one record, such as the certificates made for an inspection result, newest first. Reading them needs access to the record.",
        "tags": ["documents"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "INSPECTION_CERTIFICATE",
                "INVOICE",
                "QUOTE",
                "DELIVERY_NOTE",
                "PICKING_LIST",
                "RETURN_NOTE",
                "CREW_CALL_SHEET",
                "PROJECT_NOTES",
                "CLIENT_STATEMENT"
              ],
              "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
            },
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          {
            "name": "recordUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of what the documents are about, for the kind: for `INSPECTION_CERTIFICATE`, the inspection result; for `INVOICE`, the invoice; for `QUOTE`, the quote; for `DELIVERY_NOTE`, `PICKING_LIST`, `RETURN_NOTE`, `CREW_CALL_SHEET` and `PROJECT_NOTES`, the project; for `CLIENT_STATEMENT`, the client"
            },
            "description": "UUID of what the documents are about, for the kind: for `INSPECTION_CERTIFICATE`, the inspection result; for `INVOICE`, the invoice; for `QUOTE`, the quote; for `DELIVERY_NOTE`, `PICKING_LIST`, `RETURN_NOTE`, `CREW_CALL_SHEET` and `PROJECT_NOTES`, the project; for `CLIENT_STATEMENT`, the client"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "documents.list",
        "summary": "List a record's documents",
        "description": "Returns the documents made for one record, such as the certificates made for an inspection result, newest first. Reading them needs access to the record.",
        "tags": ["documents"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/documents/list-for-project": {
      "get": {
        "operationId": "documents.list-for-project.get",
        "summary": "List a project's documents",
        "description": "Returns every document kept on a project and its sub-projects, such as quotes, invoices, delivery notes and call sheets, newest first. Reading them needs access to the project.",
        "tags": ["documents"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project. Documents made for its sub-projects are included"
            },
            "description": "UUID of the project. Documents made for its sub-projects are included"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentsListForProjectOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "documents.list-for-project",
        "summary": "List a project's documents",
        "description": "Returns every document kept on a project and its sub-projects, such as quotes, invoices, delivery notes and call sheets, newest first. Reading them needs access to the project.",
        "tags": ["documents"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsListForProjectInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentsListForProjectOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/documents/email": {
      "post": {
        "operationId": "documents.email",
        "summary": "Email a document to the client",
        "description": "Emails a document kept on a project, such as a quote or invoice, to some of the project's client's contacts, with the PDF attached and an optional message. Replies go to the member who sent it. It reads the project and the client's contacts through their own functions, so it needs access to them too; for AI-written code and Apps those reads are allowed as part of this call. The project's history records who it was sent to.",
        "tags": ["documents"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsEmailInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentsEmailOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CONTACT_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, NO_CLIENT, REJECTED_BY_APP, TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED, SEND_FAILED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/documents/create-batch": {
      "post": {
        "operationId": "documents.create-batch",
        "summary": "Make documents in a batch",
        "description": "Starts making one document of a kind for each of up to 100 records, such as a delivery note for each of tomorrow's projects, in the background. Each is made and kept exactly as documents.create would, as the member who started the batch. Follow it with documents.get-batch.",
        "tags": ["documents"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsCreateBatchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentBatch"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/documents/get-batch": {
      "get": {
        "operationId": "documents.get-batch.get",
        "summary": "Get a batch of documents",
        "description": "Returns how a batch from documents.create-batch is going, and each document made so far. Only the member who started a batch can read it.",
        "tags": ["documents"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the batch, from documents.create-batch"
            },
            "description": "UUID of the batch, from documents.create-batch"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentBatch"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "documents.get-batch",
        "summary": "Get a batch of documents",
        "description": "Returns how a batch from documents.create-batch is going, and each document made so far. Only the member who started a batch can read it.",
        "tags": ["documents"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsGetBatchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentBatch"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/document-settings/get": {
      "get": {
        "operationId": "document-settings.get.get",
        "summary": "Get document settings",
        "description": "Returns the settings for every document the organisation makes, such as whether each page says it was made with AdamRMS.",
        "tags": ["document-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "document-settings.get",
        "summary": "Get document settings",
        "description": "Returns the settings for every document the organisation makes, such as whether each page says it was made with AdamRMS.",
        "tags": ["document-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSettingsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/document-settings/update": {
      "post": {
        "operationId": "document-settings.update",
        "summary": "Update document settings",
        "description": "Changes the settings for every document, such as whether each page says it was made with AdamRMS. Documents already made are not changed.",
        "tags": ["document-settings"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "DOCUMENT_TEMPLATES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentSettings"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/certification-types/list": {
      "get": {
        "operationId": "certification-types.list.get",
        "summary": "List certification types",
        "description": "Returns the organisation's certification types, such as 'IPAF 3a' or 'First aid at work', with how many members currently hold each.",
        "tags": ["certification-types"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return types whose name contains this text",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return types whose name contains this text"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of certification types per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of certification types per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort certification types by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort certification types by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CertificationTypesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "certification-types.list",
        "summary": "List certification types",
        "description": "Returns the organisation's certification types, such as 'IPAF 3a' or 'First aid at work', with how many members currently hold each.",
        "tags": ["certification-types"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertificationTypesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CertificationTypesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/certification-types/create": {
      "post": {
        "operationId": "certification-types.create",
        "summary": "Create a certification type",
        "description": "Creates a certification type. A name already used by another live type (ignoring case) is refused.",
        "tags": ["certification-types"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CERTIFICATION_TYPES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertificationTypesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CertificationType"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/certification-types/update": {
      "post": {
        "operationId": "certification-types.update",
        "summary": "Update a certification type",
        "description": "Changes a certification type's name, description or validity. Certifications already recorded keep their expiry dates. Fields that are omitted are left unchanged.",
        "tags": ["certification-types"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CERTIFICATION_TYPES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertificationTypesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CertificationType"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/certification-types/delete": {
      "post": {
        "operationId": "certification-types.delete",
        "summary": "Delete a certification type",
        "description": "Soft-deletes a certification type. Certifications members already hold keep it. A type that a live training module awards is refused.",
        "tags": ["certification-types"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "CERTIFICATION_TYPES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertificationTypesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CertificationTypesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/list": {
      "get": {
        "operationId": "member-certifications.list.get",
        "summary": "List members' certifications",
        "description": "Returns certifications members hold, filtered by member, type or state. Each comes with its status (valid, expiring soon, expired, unverified or revoked) and its evidence files. Anyone can list their own.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "memberUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only this member's certifications. Anyone can list their own; everyone else's needs permission to view members' certifications",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only this member's certifications. Anyone can list their own; everyone else's needs permission to view members' certifications"
          },
          {
            "name": "typeUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only certifications of this type",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only certifications of this type"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only certifications in this state. Omit for all but revoked",
              "type": "string",
              "enum": ["VALID", "EXPIRING", "EXPIRED", "UNVERIFIED", "REVOKED"]
            },
            "description": "Only certifications in this state. Omit for all but revoked"
          },
          {
            "name": "includeRevoked",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "description": "Also return revoked certifications, when no status is given",
              "type": "boolean"
            },
            "description": "Also return revoked certifications, when no status is given"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of certifications per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of certifications per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "expiresOn",
              "description": "Field to sort certifications by. Defaults to `expiresOn`",
              "type": "string",
              "enum": ["gainedOn", "expiresOn", "createdAt"]
            },
            "description": "Field to sort certifications by. Defaults to `expiresOn`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertificationsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "member-certifications.list",
        "summary": "List members' certifications",
        "description": "Returns certifications members hold, filtered by member, type or state. Each comes with its status (valid, expiring soon, expired, unverified or revoked) and its evidence files. Anyone can list their own.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertificationsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/get": {
      "get": {
        "operationId": "member-certifications.get.get",
        "summary": "Get a certification",
        "description": "Returns one certification a member holds.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the certification"
            },
            "description": "UUID of the certification"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "member-certifications.get",
        "summary": "Get a certification",
        "description": "Returns one certification a member holds.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/create": {
      "post": {
        "operationId": "member-certifications.create",
        "summary": "Record a certification",
        "description": "Records a certification a member holds, such as their IPAF card. One recorded for someone else is verified at once. One a member adds for themselves is unverified, so doesn't count, until someone verifies it. The expiry is worked out from the type's validity unless given.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: EXPIRES_BEFORE_GAINED, IDEMPOTENCY_KEY_REUSED, MEMBER_NOT_FOUND, REJECTED_BY_APP, TYPE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/update": {
      "post": {
        "operationId": "member-certifications.update",
        "summary": "Update a certification",
        "description": "Changes a certification's type, dates, issuer, reference or comment. Members can change their own while it is unverified. A revoked certification can't be changed. Fields that are omitted are left unchanged.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, REVOKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: EXPIRES_BEFORE_GAINED, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TYPE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/verify": {
      "post": {
        "operationId": "member-certifications.verify",
        "summary": "Verify a certification",
        "description": "Marks a certification a member added for themselves as checked, so it counts.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MEMBER_CERTIFICATIONS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsVerifyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_VERIFIED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, REVOKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/revoke": {
      "post": {
        "operationId": "member-certifications.revoke",
        "summary": "Revoke a certification",
        "description": "Stops a certification counting, with a reason. It stays on record as revoked.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "MEMBER_CERTIFICATIONS.REVOKE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsRevokeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_REVOKED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/revoke-all": {
      "post": {
        "operationId": "member-certifications.revoke-all",
        "summary": "Revoke every certification of a type",
        "description": "Revokes every member's certification of one type, with a reason, such as when a course changes and everyone must take it again.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "MEMBER_CERTIFICATIONS.REVOKE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsRevokeAllInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertificationsRevokeAllOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, TYPE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/delete": {
      "post": {
        "operationId": "member-certifications.delete",
        "summary": "Delete an unverified certification",
        "description": "Deletes a certification that hasn't been verified, such as one a member added by mistake. Its evidence goes to the trash. Verified certifications are revoked instead.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertificationsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, VERIFIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/check": {
      "get": {
        "operationId": "member-certifications.check.get",
        "summary": "Check members hold certifications",
        "description": "For each member, says whether they hold a verified certification of each type that is still valid on a day, such as the last day of a project. Use it to warn before giving someone work that needs a certification.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MEMBER_CERTIFICATIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "memberUUIDs",
            "in": "query",
            "required": true,
            "schema": {
              "minItems": 1,
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "description": "The members to check, at most 100"
            },
            "description": "The members to check, at most 100"
          },
          {
            "name": "typeUUIDs",
            "in": "query",
            "required": true,
            "schema": {
              "minItems": 1,
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "description": "The certification types each must hold, at most 50"
            },
            "description": "The certification types each must hold, at most 50"
          },
          {
            "name": "validOn",
            "in": "query",
            "required": false,
            "schema": {
              "description": "The day they must be valid on, YYYY-MM-DD, such as the last day of a project. Defaults to today",
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            },
            "description": "The day they must be valid on, YYYY-MM-DD, such as the last day of a project. Defaults to today"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertificationsCheckOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "member-certifications.check",
        "summary": "Check members hold certifications",
        "description": "For each member, says whether they hold a verified certification of each type that is still valid on a day, such as the last day of a project. Use it to warn before giving someone work that needs a certification.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "MEMBER_CERTIFICATIONS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsCheckInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertificationsCheckOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/start-evidence-upload": {
      "post": {
        "operationId": "member-certifications.start-evidence-upload",
        "summary": "Start uploading a certification's evidence",
        "description": "Checks a photo or PDF of the card or certificate can be added to a certification (at most 5 each), and returns a private URL to PUT its bytes to. The file is added once `member-certifications.finish-evidence-upload` is called. Members can add evidence to their own certifications.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsStartEvidenceUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertificationsStartEvidenceUploadOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FILE_TOO_LARGE, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY_FILES",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/finish-evidence-upload": {
      "post": {
        "operationId": "member-certifications.finish-evidence-upload",
        "summary": "Finish uploading a certification's evidence",
        "description": "Completes an upload begun with `member-certifications.start-evidence-upload` and adds the file to the certification.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsFinishEvidenceUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, UPLOAD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY_FILES, UPLOAD_INCOMPLETE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/member-certifications/remove-evidence": {
      "post": {
        "operationId": "member-certifications.remove-evidence",
        "summary": "Remove a certification's evidence",
        "description": "Takes a photo or PDF off a certification. The file goes to the trash, where it waits 30 days. Members can remove evidence from their own certifications until they are verified.",
        "tags": ["member-certifications"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "CERTIFICATION_TYPES.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberCertificationsRemoveEvidenceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-modules/list": {
      "get": {
        "operationId": "training-modules.list.get",
        "summary": "List training modules",
        "description": "Returns the training modules the caller may see, with how far the caller has got through each and whether they hold the certification it awards.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "TRAINING_MODULES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only return modules whose name contains this text",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only return modules whose name contains this text"
          },
          {
            "name": "published",
            "in": "query",
            "required": false,
            "schema": {
              "default": "ALL",
              "description": "Which modules to return. Members who can't edit modules only ever see published ones",
              "type": "string",
              "enum": ["PUBLISHED", "DRAFT", "ALL"]
            },
            "description": "Which modules to return. Members who can't edit modules only ever see published ones"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of training modules per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of training modules per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "description": "Field to sort training modules by. Defaults to `name`",
              "type": "string",
              "enum": ["name", "createdAt", "updatedAt"]
            },
            "description": "Field to sort training modules by. Defaults to `name`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "training-modules.list",
        "summary": "List training modules",
        "description": "Returns the training modules the caller may see, with how far the caller has got through each and whether they hold the certification it awards.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "TRAINING_MODULES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingModulesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-modules/get": {
      "get": {
        "operationId": "training-modules.get.get",
        "summary": "Get a training module",
        "description": "Returns a training module with its steps in order, and which of them the caller has done.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "TRAINING_MODULES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the module"
            },
            "description": "UUID of the module"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "training-modules.get",
        "summary": "Get a training module",
        "description": "Returns a training module with its steps in order, and which of them the caller has done.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "TRAINING_MODULES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingModulesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-modules/create": {
      "post": {
        "operationId": "training-modules.create",
        "summary": "Create a training module",
        "description": "Creates a training module, as a draft unless published is set. HYBRID and IN_PERSON modules must award a certification type, because signing someone off records one. Add its steps with `training-steps.create`.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "TRAINING_MODULES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingModulesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModule"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CERTIFICATION_TYPE_NOT_FOUND, CERTIFICATION_TYPE_REQUIRED, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-modules/update": {
      "post": {
        "operationId": "training-modules.update",
        "summary": "Update a training module",
        "description": "Changes a training module's details, type, what it awards, who can see it, or publishes it. Fields that are omitted are left unchanged.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "TRAINING_MODULES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingModulesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModule"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CERTIFICATION_TYPE_NOT_FOUND, CERTIFICATION_TYPE_REQUIRED, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, ROLE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-modules/delete": {
      "post": {
        "operationId": "training-modules.delete",
        "summary": "Delete a training module",
        "description": "Soft-deletes a training module and its steps. Certifications it awarded are kept.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "TRAINING_MODULES.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingModulesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-modules/progress": {
      "get": {
        "operationId": "training-modules.progress.get",
        "summary": "See members' progress through a module",
        "description": "Returns every member who has started a training module: how many steps they have done, when they finished, whether they hold its certification, and whether they wait to be signed off.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "TRAINING_MODULES.VIEW_PROGRESS",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the module"
            },
            "description": "UUID of the module"
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "default": "ALL",
              "description": "ALL, IN_PROGRESS (started, not finished), READY_FOR_SIGN_OFF (finished a HYBRID module, not yet certified) or COMPLETED",
              "type": "string",
              "enum": ["ALL", "IN_PROGRESS", "READY_FOR_SIGN_OFF", "COMPLETED"]
            },
            "description": "ALL, IN_PROGRESS (started, not finished), READY_FOR_SIGN_OFF (finished a HYBRID module, not yet certified) or COMPLETED"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of members per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of members per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "updatedAt",
              "description": "Field to sort members by. Defaults to `updatedAt`",
              "type": "string",
              "enum": ["updatedAt", "startedAt"]
            },
            "description": "Field to sort members by. Defaults to `updatedAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesProgressOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "training-modules.progress",
        "summary": "See members' progress through a module",
        "description": "Returns every member who has started a training module: how many steps they have done, when they finished, whether they hold its certification, and whether they wait to be signed off.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "TRAINING_MODULES.VIEW_PROGRESS",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingModulesProgressInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesProgressOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-modules/sign-off": {
      "post": {
        "operationId": "training-modules.sign-off",
        "summary": "Sign a member off on a module",
        "description": "Records that a member has shown they can do what a training module teaches, with a comment, by giving them a verified certification of the type it awards. Used for HYBRID and IN_PERSON modules, and to certify someone without the steps.",
        "tags": ["training-modules"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "MEMBER_CERTIFICATIONS.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingModulesSignOffInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MemberCertification"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, MEMBER_NOT_FOUND, NO_CERTIFICATION_TYPE, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-steps/create": {
      "post": {
        "operationId": "training-steps.create",
        "summary": "Add a step to a training module",
        "description": "Adds a text or YouTube video step to the end of a training module, which can hold 100 steps.",
        "tags": ["training-steps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "TRAINING_MODULES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingStepsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesGetOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY_STEPS, VIDEO_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-steps/update": {
      "post": {
        "operationId": "training-steps.update",
        "summary": "Update a training step",
        "description": "Changes a step's title, text, video, estimated time, editor notes, or whether members see it. Fields that are omitted are left unchanged.",
        "tags": ["training-steps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "TRAINING_MODULES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingStepsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesGetOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, VIDEO_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-steps/move": {
      "post": {
        "operationId": "training-steps.move",
        "summary": "Move a training step",
        "description": "Moves a step one place earlier or later in its module.",
        "tags": ["training-steps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "TRAINING_MODULES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingStepsMoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesGetOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-steps/delete": {
      "post": {
        "operationId": "training-steps.delete",
        "summary": "Delete a training step",
        "description": "Soft-deletes a step. Members who did it keep their progress through the other steps.",
        "tags": ["training-steps"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "TRAINING_MODULES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingStepsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingModulesGetOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/training-steps/complete": {
      "post": {
        "operationId": "training-steps.complete",
        "summary": "Mark a training step done",
        "description": "Records that the caller has done a published step of a module they can see. Finishing every step of an ONLINE module awards its certification; finishing a HYBRID module puts the caller on the list to be signed off.",
        "tags": ["training-steps"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "TRAINING_MODULES.VIEW",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingStepsCompleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TrainingStepsCompleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, IN_PERSON, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/finance-settings/get": {
      "get": {
        "operationId": "finance-settings.get.get",
        "summary": "Get finance settings",
        "description": "Returns how quotes, invoices and credit notes are numbered (prefix, next number and digits), the payment terms, how long quotes are valid, the default deposit, and the discount on what comes in a case.",
        "tags": ["finance-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FinanceSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "finance-settings.get",
        "summary": "Get finance settings",
        "description": "Returns how quotes, invoices and credit notes are numbered (prefix, next number and digits), the payment terms, how long quotes are valid, the default deposit, and the discount on what comes in a case.",
        "tags": ["finance-settings"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinanceSettingsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FinanceSettings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/finance-settings/update": {
      "post": {
        "operationId": "finance-settings.update",
        "summary": "Update finance settings",
        "description": "Changes how quotes, invoices and credit notes are numbered, the payment terms, quote validity, the default deposit or the discount on what comes in a case. Fields that are omitted are left unchanged. A next number can't go back to one already used, and invoices and credit notes need different prefixes.",
        "tags": ["finance-settings"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinanceSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FinanceSettings"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NUMBER_USED, PREFIX_CLASH",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-finance/get": {
      "get": {
        "operationId": "project-finance.get.get",
        "summary": "Get a project's money",
        "description": "Returns a project's money, with its sub-projects: the total of what's on it, what's been invoiced and paid, what the client still owes, and damage deposits held.",
        "tags": ["project-finance"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project. Its sub-projects are included"
            },
            "description": "UUID of the project. Its sub-projects are included"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectFinance"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-finance.get",
        "summary": "Get a project's money",
        "description": "Returns a project's money, with its sub-projects: the total of what's on it, what's been invoiced and paid, what the client still owes, and damage deposits held.",
        "tags": ["project-finance"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectFinanceGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectFinance"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-finance/list": {
      "get": {
        "operationId": "client-finance.list.get",
        "summary": "Get clients' money",
        "description": "Returns, for each client asked for, the total of their projects, what's been invoiced and paid, and what they still owe. A project's sub-projects count towards it. Lost and deleted projects, and those of a type without finance, are left out. Sub-clients' projects aren't included in their parent's.",
        "tags": ["client-finance"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "clientUUIDs",
            "in": "query",
            "required": true,
            "schema": {
              "minItems": 1,
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "description": "UUIDs of the clients to total, such as a page of clients.list. At most 100"
            },
            "description": "UUIDs of the clients to total, such as a page of clients.list. At most 100"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientFinanceListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "client-finance.list",
        "summary": "Get clients' money",
        "description": "Returns, for each client asked for, the total of their projects, what's been invoiced and paid, and what they still owe. A project's sub-projects count towards it. Lost and deleted projects, and those of a type without finance, are left out. Sub-clients' projects aren't included in their parent's.",
        "tags": ["client-finance"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientFinanceListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientFinanceListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/client-statements/get": {
      "get": {
        "operationId": "client-statements.get.get",
        "summary": "Get a client's statement",
        "description": "Returns a client's statement: their issued invoices, deposit invoices and credit notes, and the payments and refunds on their projects, oldest first with a running balance of what they owe. Also returns what's still to pay on each unpaid invoice, and how much of it is overdue. Damage deposits held aren't on it, and nor is work not yet invoiced: client-finance.list has the total of their projects. A project's sub-projects count towards it. Sub-clients' projects don't, and nor do projects in trash.",
        "tags": ["client-statements"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "clientUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the client, from clients.list"
            },
            "description": "UUID of the client, from clients.list"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Start of the statement, as an ISO 8601 date and time. Everything before it is added up into the opening balance. Omit to start from the first invoice",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Start of the statement, as an ISO 8601 date and time. Everything before it is added up into the opening balance. Omit to start from the first invoice"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "description": "End of the statement: only what's dated before this is on it. Omit for up to now",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "End of the statement: only what's dated before this is on it. Omit for up to now"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientStatement"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "client-statements.get",
        "summary": "Get a client's statement",
        "description": "Returns a client's statement: their issued invoices, deposit invoices and credit notes, and the payments and refunds on their projects, oldest first with a running balance of what they owe. Also returns what's still to pay on each unpaid invoice, and how much of it is overdue. Damage deposits held aren't on it, and nor is work not yet invoiced: client-finance.list has the total of their projects. A project's sub-projects count towards it. Sub-clients' projects don't, and nor do projects in trash.",
        "tags": ["client-statements"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientStatementsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClientStatement"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payment-methods/list": {
      "get": {
        "operationId": "payment-methods.list.get",
        "summary": "List payment methods",
        "description": "Returns the ways the organisation records money being paid, such as bank transfer, card or cash.",
        "tags": ["payment-methods"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PAYMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of payment methods per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of payment methods per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "position",
              "description": "Field to sort payment methods by. Defaults to `position`",
              "type": "string",
              "enum": ["position", "name"]
            },
            "description": "Field to sort payment methods by. Defaults to `position`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "asc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentMethodsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "payment-methods.list",
        "summary": "List payment methods",
        "description": "Returns the ways the organisation records money being paid, such as bank transfer, card or cash.",
        "tags": ["payment-methods"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PAYMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentMethodsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentMethodsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payment-methods/create": {
      "post": {
        "operationId": "payment-methods.create",
        "summary": "Create a payment method",
        "description": "Adds a payment method at the end of the list. A name already used by another method (ignoring case) is refused.",
        "tags": ["payment-methods"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentMethodsCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentMethod"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, TOO_MANY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payment-methods/update": {
      "post": {
        "operationId": "payment-methods.update",
        "summary": "Rename a payment method",
        "description": "Renames a payment method. Payments already recorded with it show the new name.",
        "tags": ["payment-methods"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentMethodsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentMethod"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payment-methods/delete": {
      "post": {
        "operationId": "payment-methods.delete",
        "summary": "Delete a payment method",
        "description": "Deletes a payment method, so it can't be chosen for new payments. Payments already recorded with it keep it.",
        "tags": ["payment-methods"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "ORGANISATIONS_SETTINGS.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentMethodsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentMethodsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payments/list": {
      "get": {
        "operationId": "payments.list.get",
        "summary": "List payments",
        "description": "Returns the ledger: payments received, refunds and damage deposits, across the organisation, on one project and its sub-projects, or on one client's projects, newest first by default.",
        "tags": ["payments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PAYMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only payments on this project and its sub-projects. Omit for the whole organisation's ledger",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only payments on this project and its sub-projects. Omit for the whole organisation's ledger"
          },
          {
            "name": "clientUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only payments on this client's projects and their sub-projects. Sub-clients' projects aren't included",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only payments on this client's projects and their sub-projects. Sub-clients' projects aren't included"
          },
          {
            "name": "invoiceUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only payments of this invoice",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only payments of this invoice"
          },
          {
            "name": "kinds",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only these kinds. Omit for every kind",
              "maxItems": 5,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "PAYMENT",
                  "REFUND",
                  "DEPOSIT_TAKEN",
                  "DEPOSIT_RETURNED",
                  "DEPOSIT_RETAINED"
                ]
              }
            },
            "description": "Only these kinds. Omit for every kind"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only payments whose reference or comment contains this text (case-insensitive), or whose amount in the smallest currency unit is this number",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only payments whose reference or comment contains this text (case-insensitive), or whose amount in the smallest currency unit is this number"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only payments on or after this date and time",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Only payments on or after this date and time"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only payments before this date and time",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Only payments before this date and time"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of payments per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of payments per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "date",
              "description": "Field to sort payments by. Defaults to `date`",
              "type": "string",
              "enum": ["date", "amount", "createdAt"]
            },
            "description": "Field to sort payments by. Defaults to `date`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, INVOICE_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "payments.list",
        "summary": "List payments",
        "description": "Returns the ledger: payments received, refunds and damage deposits, across the organisation, on one project and its sub-projects, or on one client's projects, newest first by default.",
        "tags": ["payments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PAYMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, INVOICE_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payments/get": {
      "get": {
        "operationId": "payments.get.get",
        "summary": "Get a payment",
        "description": "Returns one payment, refund or deposit, with how many files (such as receipts) are attached to it.",
        "tags": ["payments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PAYMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the payment"
            },
            "description": "UUID of the payment"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "payments.get",
        "summary": "Get a payment",
        "description": "Returns one payment, refund or deposit, with how many files (such as receipts) are attached to it.",
        "tags": ["payments"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PAYMENTS.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsGetOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payments/record": {
      "post": {
        "operationId": "payments.record",
        "summary": "Record a payment",
        "description": "Records money paid on a project, optionally against one of its issued invoices: a payment received, a refund, a damage deposit taken, or a held deposit paid back. Money isn't taken here: this records what already happened.",
        "tags": ["payments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PAYMENTS.RECORD",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsRecordInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Payment"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, INVOICE_NOT_FOUND, METHOD_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: DEPOSIT_EXCEEDED, FINANCE_OFF, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, INVOICE_NOT_ISSUED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payments/retain-deposit": {
      "post": {
        "operationId": "payments.retain-deposit",
        "summary": "Keep part of a deposit",
        "description": "Keeps some of a damage deposit held on a project, such as for damage. Adds a charge to the project for the amount, and records the kept money as the payment for it.",
        "tags": ["payments"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PAYMENTS.RECORD",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsRetainDepositInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsRetainDepositOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, METHOD_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, TAX_RATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: DEPOSIT_EXCEEDED, FINANCE_OFF, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/payments/delete": {
      "post": {
        "operationId": "payments.delete",
        "summary": "Delete a payment",
        "description": "Deletes a payment recorded by mistake. A retained deposit and its payment go together, and the charge it became stays on the project to remove separately.",
        "tags": ["payments"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PAYMENTS.DELETE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: DEPOSIT_EXCEEDED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invoices/list": {
      "get": {
        "operationId": "invoices.list.get",
        "summary": "List invoices",
        "description": "Returns invoices, deposit invoices and credit notes, across the organisation, for one project and its sub-projects, or for one client's projects, with what's been paid on each. Newest first by default.",
        "tags": ["invoices"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only invoices for this project and its sub-projects. Omit for every project",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only invoices for this project and its sub-projects. Omit for every project"
          },
          {
            "name": "clientUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only invoices for this client's projects and their sub-projects. Sub-clients' projects aren't included",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only invoices for this client's projects and their sub-projects. Sub-clients' projects aren't included"
          },
          {
            "name": "kinds",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only these kinds. Omit for every kind",
              "maxItems": 3,
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["INVOICE", "DEPOSIT", "CREDIT_NOTE"]
              }
            },
            "description": "Only these kinds. Omit for every kind"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only drafts, or only issued. Omit for both",
              "type": "string",
              "enum": ["DRAFT", "ISSUED"]
            },
            "description": "Only drafts, or only issued. Omit for both"
          },
          {
            "name": "unpaid",
            "in": "query",
            "required": false,
            "schema": {
              "description": "True for only issued invoices with something still to pay, which aren't credited",
              "type": "boolean"
            },
            "description": "True for only issued invoices with something still to pay, which aren't credited"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only invoices whose number or reference contains this text (case-insensitive)",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only invoices whose number or reference contains this text (case-insensitive)"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only invoices issued on or after this date and time",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Only invoices issued on or after this date and time"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only invoices issued before this date and time",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Only invoices issued before this date and time"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of invoices per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of invoices per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort invoices by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt", "issuedAt", "number", "dueAt", "gross"]
            },
            "description": "Field to sort invoices by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoicesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "invoices.list",
        "summary": "List invoices",
        "description": "Returns invoices, deposit invoices and credit notes, across the organisation, for one project and its sub-projects, or for one client's projects, with what's been paid on each. Newest first by default.",
        "tags": ["invoices"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoicesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: CLIENT_NOT_FOUND, FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invoices/get": {
      "get": {
        "operationId": "invoices.get.get",
        "summary": "Get an invoice",
        "description": "Returns one invoice, deposit invoice or credit note with its lines, who it's made out to, its totals with tax by rate, and what's been paid.",
        "tags": ["invoices"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the invoice"
            },
            "description": "UUID of the invoice"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "invoices.get",
        "summary": "Get an invoice",
        "description": "Returns one invoice, deposit invoice or credit note with its lines, who it's made out to, its totals with tax by rate, and what's been paid.",
        "tags": ["invoices"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "INVOICES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invoices/create-draft": {
      "post": {
        "operationId": "invoices.create-draft",
        "summary": "Draft an invoice",
        "description": "Drafts an invoice for a project and its sub-projects. An INVOICE takes every charged line not yet on an invoice, lines that changed since they were invoiced as adjustments, and takes off deposit invoices already issued. A DEPOSIT asks for a share of the project's total, or a fixed amount, split across its tax rates. Drafts can be changed or deleted until they're issued.",
        "tags": ["invoices"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "INVOICES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesCreateDraftInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceDetail"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DEPOSIT_REQUIRED, DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: FINANCE_OFF, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOTHING_TO_INVOICE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invoices/update-draft": {
      "post": {
        "operationId": "invoices.update-draft",
        "summary": "Change a draft invoice",
        "description": "Changes a draft invoice's reference, notes or due date, or builds its lines again from the project as it is now. Issued invoices never change.",
        "tags": ["invoices"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "INVOICES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesUpdateDraftInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceDetail"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOTHING_TO_INVOICE, NOT_DRAFT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invoices/delete-draft": {
      "post": {
        "operationId": "invoices.delete-draft",
        "summary": "Delete a draft invoice",
        "description": "Deletes a draft invoice, so its lines can go on another. Issued invoices are never deleted: cancel one with a credit note instead.",
        "tags": ["invoices"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "INVOICES.CREATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesDeleteDraftInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoicesDeleteDraftOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_DRAFT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invoices/issue": {
      "post": {
        "operationId": "invoices.issue",
        "summary": "Issue an invoice",
        "description": "Issues a draft invoice: gives it the next invoice number, sets its due date from the payment terms if it has none, and copies who it's made out to. It can't be changed or deleted afterwards. The PDF is made separately, with documents.create.",
        "tags": ["invoices"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "INVOICES.ISSUE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesIssueInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceDetail"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: EMPTY, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOT_DRAFT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/invoices/credit": {
      "post": {
        "operationId": "invoices.credit",
        "summary": "Cancel an invoice with a credit note",
        "description": "Issues a credit note for an issued invoice, numbered from the credit note sequence. Without `lines` it cancels the whole invoice (less anything partial credit notes took off already). With `lines` it credits only those lines, or part of them, and the invoice stays live with less to pay. Either way, what's credited is free to go on a new invoice, so to give money off, lower the line on the project first and credit the same amount. Only invoices, not deposit invoices, can be partly credited. A deposit invoice already taken off a later invoice can't be credited until that invoice is.",
        "tags": ["invoices"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "INVOICES.CREDIT",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesCreditInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceDetail"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_CREDITED, DEPOSIT_DEDUCTED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, IS_CREDIT_NOTE, NOT_ISSUED, NOT_PARTLY_CREDITABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, LINE_NOT_FOUND, MORE_THAN_LEFT, NO_LINES, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/quotes/list": {
      "get": {
        "operationId": "quotes.list.get",
        "summary": "List quotes",
        "description": "Returns quotes issued, across the organisation or for one project and its sub-projects, with whether each was accepted. Newest first by default.",
        "tags": ["quotes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "QUOTES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only quotes for this project and its sub-projects. Omit for every project",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only quotes for this project and its sub-projects. Omit for every project"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only quotes with this status. Omit for all",
              "type": "string",
              "enum": ["ISSUED", "ACCEPTED", "DECLINED"]
            },
            "description": "Only quotes with this status. Omit for all"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only quotes whose number contains this text",
              "type": "string",
              "maxLength": 255
            },
            "description": "Only quotes whose number contains this text"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of quotes per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of quotes per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "issuedAt",
              "description": "Field to sort quotes by. Defaults to `issuedAt`",
              "type": "string",
              "enum": ["issuedAt", "number", "gross"]
            },
            "description": "Field to sort quotes by. Defaults to `issuedAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuotesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "quotes.list",
        "summary": "List quotes",
        "description": "Returns quotes issued, across the organisation or for one project and its sub-projects, with whether each was accepted. Newest first by default.",
        "tags": ["quotes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "QUOTES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuotesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/quotes/get": {
      "get": {
        "operationId": "quotes.get.get",
        "summary": "Get a quote",
        "description": "Returns one quote with its lines and totals as they were when it was issued, and whether the project has changed since.",
        "tags": ["quotes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "QUOTES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the quote"
            },
            "description": "UUID of the quote"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuoteDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "quotes.get",
        "summary": "Get a quote",
        "description": "Returns one quote with its lines and totals as they were when it was issued, and whether the project has changed since.",
        "tags": ["quotes"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "QUOTES.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuoteDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/quotes/issue": {
      "post": {
        "operationId": "quotes.issue",
        "summary": "Issue a quote",
        "description": "Freezes what's on a project and its sub-projects now as a numbered quote, the project's next version. Later changes to the project don't change it: issue another to quote again. The PDF is made separately, with documents.create.",
        "tags": ["quotes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "QUOTES.ISSUE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotesIssueInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuoteDetail"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: FINANCE_OFF, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, NOTHING_TO_QUOTE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/quotes/decide": {
      "post": {
        "operationId": "quotes.decide",
        "summary": "Record the client's answer to a quote",
        "description": "Records that the client accepted or declined a quote, and who answered. Each quote is answered once. It doesn't change the project's status.",
        "tags": ["quotes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "QUOTES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotesDecideInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuoteDetail"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_DECIDED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/quotes/share": {
      "post": {
        "operationId": "quotes.share",
        "summary": "Get a quote's link for the client",
        "description": "Returns the secret for a link the client can open without signing in, to see the quote and accept or decline it. Makes one the first time; after that it returns the same one until it's revoked. Only quotes still waiting for an answer can be shared.",
        "tags": ["quotes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "QUOTES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotesShareInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuotesShareOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_DECIDED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/quotes/revoke-link": {
      "post": {
        "operationId": "quotes.revoke-link",
        "summary": "Stop a quote's link working",
        "description": "Stops the link from quotes.share working, such as when it went to the wrong person. Sharing again makes a new link.",
        "tags": ["quotes"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "QUOTES.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotesRevokeLinkInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuotesRevokeLinkOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-crew/list": {
      "get": {
        "operationId": "project-crew.list.get",
        "summary": "List a project's crew",
        "description": "Returns the people on a project's crew, in order, each with their role. A member crewed on another live project at the same time has that project listed under clashes.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project"
            },
            "description": "UUID of the project"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-crew.list",
        "summary": "List a project's crew",
        "description": "Returns the people on a project's crew, in order, each with their role. A member crewed on another live project at the same time has that project listed under clashes.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCrewListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-crew/list-for-member": {
      "get": {
        "operationId": "project-crew.list-for-member.get",
        "summary": "List a member's crew roles",
        "description": "Returns the projects a member is on the crew of, with their role and the project's dates, newest first.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "memberUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the member"
            },
            "description": "UUID of the member"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of crew places per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of crew places per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort crew places by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt"]
            },
            "description": "Field to sort crew places by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewListForMemberOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-crew.list-for-member",
        "summary": "List a member's crew roles",
        "description": "Returns the projects a member is on the crew of, with their role and the project's dates, newest first.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCrewListForMemberInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewListForMemberOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-crew/assign": {
      "post": {
        "operationId": "project-crew.assign",
        "summary": "Add someone to a project's crew",
        "description": "Puts a member, or a named person who isn't a member (such as a freelancer), on a project's crew with a role, optionally charged as a service. The same person can hold several roles. A member already crewed elsewhere at the same time is still added: the clash is shown, not refused. The member is emailed.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCrewAssignInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewMember"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, MEMBER_NOT_FOUND, REJECTED_BY_APP, SERVICE_NOT_FOUND, TOO_MANY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-crew/update": {
      "post": {
        "operationId": "project-crew.update",
        "summary": "Change a crew role",
        "description": "Changes someone's role, comment or the service they're charged as on a project's crew. A member whose role changes is emailed.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCrewUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewMember"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, SERVICE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-crew/remove": {
      "post": {
        "operationId": "project-crew.remove",
        "summary": "Take someone off a project's crew",
        "description": "Removes a place from a project's crew, and the line charging for it, unless an issued invoice charges for that line. A member is emailed. If an accepted application made the place, the vacancy has a place free again.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PROJECT_CREW.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCrewRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewRemoveOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-crew/reorder": {
      "post": {
        "operationId": "project-crew.reorder",
        "summary": "Reorder a project's crew",
        "description": "Puts a project's crew list in a new order, such as the most senior first.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.UPDATE",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCrewReorderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewListOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/project-crew/emails": {
      "get": {
        "operationId": "project-crew.emails.get",
        "summary": "Get the crew's email addresses",
        "description": "Returns the email address of every member on a project's crew, once each, to email them all. Named people who aren't members have none, so are listed by name.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.EMAIL",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project"
            },
            "description": "UUID of the project"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewEmailsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project-crew.emails",
        "summary": "Get the crew's email addresses",
        "description": "Returns the email address of every member on a project's crew, once each, to email them all. Named people who aren't members have none, so are listed by name.",
        "tags": ["project-crew"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.EMAIL",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCrewEmailsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectCrewEmailsOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-vacancies/list": {
      "get": {
        "operationId": "crew-vacancies.list.get",
        "summary": "List a project's vacancies",
        "description": "Returns the crew vacancies on a project, open or closed, with how many places are filled. Vacancies limited to other roles are left out, except for recruiters.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "projectUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the project"
            },
            "description": "UUID of the project"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacanciesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crew-vacancies.list",
        "summary": "List a project's vacancies",
        "description": "Returns the crew vacancies on a project, open or closed, with how many places are filled. Vacancies limited to other roles are left out, except for recruiters.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewVacanciesListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacanciesListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-vacancies/open": {
      "get": {
        "operationId": "crew-vacancies.open.get",
        "summary": "List vacancies you can apply for",
        "description": "Returns the crew vacancies taking applications that the caller's role may see: open, before their deadline, with places left, on projects that aren't finished. Each says whether the caller has applied.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of vacancies per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of vacancies per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort vacancies by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt", "name"]
            },
            "description": "Field to sort vacancies by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacanciesOpenOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crew-vacancies.open",
        "summary": "List vacancies you can apply for",
        "description": "Returns the crew vacancies taking applications that the caller's role may see: open, before their deadline, with places left, on projects that aren't finished. Each says whether the caller has applied.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewVacanciesOpenInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacanciesOpenOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-vacancies/get": {
      "get": {
        "operationId": "crew-vacancies.get.get",
        "summary": "Get a vacancy",
        "description": "Returns one crew vacancy, with its questions and the caller's own application if they have one.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the vacancy"
            },
            "description": "UUID of the vacancy"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacancy"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crew-vacancies.get",
        "summary": "Get a vacancy",
        "description": "Returns one crew vacancy, with its questions and the caller's own application if they have one.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewVacanciesGetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacancy"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-vacancies/create": {
      "post": {
        "operationId": "crew-vacancies.create",
        "summary": "Advertise a crew vacancy",
        "description": "Advertises a role on a project that members can apply for, with how many places there are, an optional deadline and questions. With first come, first served, applicants are accepted as they apply until the places are filled.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.RECRUIT",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewVacanciesCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacancy"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND, PROJECT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CERTIFICATION_TYPE_NOT_FOUND, CREW_ROLE_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, ROLE_NOT_FOUND, VIEWER_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-vacancies/update": {
      "post": {
        "operationId": "crew-vacancies.update",
        "summary": "Change a crew vacancy",
        "description": "Changes a vacancy. Fields that are omitted are left unchanged. Set open to false to stop taking applications.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.RECRUIT",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewVacanciesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacancy"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: CERTIFICATION_TYPE_NOT_FOUND, CREW_ROLE_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP, ROLE_NOT_FOUND, VIEWER_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-vacancies/delete": {
      "post": {
        "operationId": "crew-vacancies.delete",
        "summary": "Delete a crew vacancy",
        "description": "Deletes a vacancy and its applications. People already put on the crew from it stay there.",
        "tags": ["crew-vacancies"],
        "x-adamrms-kind": "destructive",
        "x-adamrms-permission": "PROJECT_CREW.RECRUIT",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewVacanciesDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewVacanciesDeleteOutput"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/list": {
      "get": {
        "operationId": "crew-applications.list.get",
        "summary": "List a vacancy's applications",
        "description": "Returns the applications for a vacancy, with each applicant's answers, files and whether they hold the certifications the vacancy asks for. Only the project's manager and the vacancy's listed viewers see them, unless the vacancy isn't private, when recruiters do too.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "vacancyUUID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the vacancy"
            },
            "description": "UUID of the vacancy"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplicationsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crew-applications.list",
        "summary": "List a vacancy's applications",
        "description": "Returns the applications for a vacancy, with each applicant's answers, files and whether they hold the certifications the vacancy asks for. Only the project's manager and the vacancy's listed viewers see them, unless the vacancy isn't private, when recruiters do too.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.VIEW",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsListInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplicationsListOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/mine": {
      "get": {
        "operationId": "crew-applications.mine.get",
        "summary": "List your applications",
        "description": "Returns the caller's own applications for crew vacancies, newest first, with where each is up to.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "name": "vacancyUUID",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Only applications for this vacancy",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Only applications for this vacancy"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
              "type": "string",
              "maxLength": 1024
            },
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of applications per page, at most 100",
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of applications per page, at most 100"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "description": "Field to sort applications by. Defaults to `createdAt`",
              "type": "string",
              "enum": ["createdAt"]
            },
            "description": "Field to sort applications by. Defaults to `createdAt`"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplicationsMineOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "crew-applications.mine",
        "summary": "List your applications",
        "description": "Returns the caller's own applications for crew vacancies, newest first, with where each is up to.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "read",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsMineInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplicationsMineOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/apply": {
      "post": {
        "operationId": "crew-applications.apply",
        "summary": "Apply for a crew vacancy",
        "description": "Applies for a vacancy as the caller, with their answers to its questions. On a first come, first served vacancy the application is accepted straight away and the caller joins the crew. The project's manager is emailed. Files, such as a CV, are attached afterwards with crew-applications.start-file-upload.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsApplyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplication"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_APPLIED, CLOSED, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, MEMBER_NOT_FOUND, PHONE_REQUIRED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/withdraw": {
      "post": {
        "operationId": "crew-applications.withdraw",
        "summary": "Withdraw your application",
        "description": "Withdraws one of the caller's own applications. If it had been accepted, the caller comes off the crew and the place is free again.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsWithdrawInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplication"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: ALREADY_WITHDRAWN, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/accept": {
      "post": {
        "operationId": "crew-applications.accept",
        "summary": "Accept an application",
        "description": "Accepts an application, putting the applicant on the project's crew with the vacancy's role. Refused once every place is filled. The applicant is emailed.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.RECRUIT",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsAcceptInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplication"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: FULL, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, UNCHANGED, WITHDRAWN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/reject": {
      "post": {
        "operationId": "crew-applications.reject",
        "summary": "Reject an application",
        "description": "Rejects an application. If it had been accepted, the applicant comes off the crew. The applicant is emailed.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.RECRUIT",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsRejectInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplication"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, PLAN_LIMIT_REACHED, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: FULL, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, UNCHANGED, WITHDRAWN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/start-file-upload": {
      "post": {
        "operationId": "crew-applications.start-file-upload",
        "summary": "Start attaching a file to your application",
        "description": "Returns a short-lived link to PUT a file to, such as a CV, for one of the caller's own applications on a vacancy that takes files. Finish with crew-applications.finish-file-upload.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsStartFileUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplicationsStartFileUploadOutput"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_ALLOWED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: FILE_TOO_LARGE, IDEMPOTENCY_KEY_REUSED, PLAN_LIMIT_REACHED, REJECTED_BY_APP, TOO_MANY_FILES",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/finish-file-upload": {
      "post": {
        "operationId": "crew-applications.finish-file-upload",
        "summary": "Finish attaching a file",
        "description": "Attaches the uploaded file to the application.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "x-adamrms-dry-run": false,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsFinishFileUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplication"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_ALLOWED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND, UPLOAD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT, UPLOAD_INCOMPLETE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, PLAN_LIMIT_REACHED, REJECTED_BY_APP, TOO_MANY_FILES",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/org/{organisationUUID}/crew-applications/remove-file": {
      "post": {
        "operationId": "crew-applications.remove-file",
        "summary": "Remove a file from your application",
        "description": "Takes a file off one of the caller's own applications and moves it to the trash.",
        "tags": ["crew-applications"],
        "x-adamrms-kind": "write",
        "x-adamrms-permission": "PROJECT_CREW.APPLY",
        "x-adamrms-dry-run": true,
        "parameters": [
          {
            "name": "organisationUUID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the organisation"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewApplicationsRemoveFileInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Dry-Run": {
                "$ref": "#/components/headers/DryRun"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrewApplication"
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present on a dry run: `data` is what the change would return, but nothing was saved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error. `code` is one of: DRY_RUN_NOT_AVAILABLE, INVALID_DRY_RUN, INVALID_IDEMPOTENCY_KEY, INVALID_INPUT, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error. `code` is one of: UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error. `code` is one of: NOT_IN_PLAN, SUBSCRIPTION_INACTIVE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error. `code` is one of: CREDENTIAL_ORGANISATION_MISMATCH, FUNCTION_NOT_GRANTED, LICENCE_REQUIRED, MFA_REQUIRED, NOT_AVAILABLE_IN_DEMO, NOT_A_MEMBER, PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error. `code` is one of: FUNCTION_NOT_FOUND, NOT_FOUND, ORGANISATION_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error. `code` is one of: METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_RESPONSE_NOT_KEPT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error. `code` is one of: IDEMPOTENCY_KEY_REUSED, REJECTED_BY_APP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error. `code` is one of: RATE_LIMITED",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error. `code` is one of: ORGANISATION_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key created under your account settings, scoped to one organisation, which acts with your own permissions there. AI agent tokens (`adamrms_agent_...`) are also accepted: they are minted when a user approves an AI's request, expire within minutes, and can only call the functions that were approved."
      }
    },
    "headers": {
      "RateLimitPolicy": {
        "description": "The rate limit (draft-ietf-httpapi-ratelimit-headers): 60 requests per 60 seconds for each user, across the API and the MCP server.",
        "schema": {
          "type": "string",
          "example": "\"api\";q=60;w=60"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer",
          "example": 60
        }
      },
      "IdempotentReplayed": {
        "description": "`true` when this is the response kept from an earlier request with the same Idempotency-Key.",
        "schema": {
          "type": "string",
          "enum": ["true"]
        }
      },
      "DryRun": {
        "description": "`true` when the request was a dry run (`?dryRun=true`): nothing was saved.",
        "schema": {
          "type": "string",
          "enum": ["true"]
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "description": "A key you make up for this change, such as a UUID. Retry with the same key and the same request, and you get the first response back (with `Idempotent-Replayed: true`) instead of the change being made twice. The same key with a different request fails with IDEMPOTENCY_KEY_REUSED, and a retry while the first is still running fails with IDEMPOTENCY_KEY_IN_USE. A response holding a secret that is shown once, such as a webhook's signing secret, isn't kept: a retry fails with IDEMPOTENCY_RESPONSE_NOT_KEPT. Keys belong to the credential that sent them and last 24 hours. Responses with a 5xx status aren't kept, so retrying those runs the request again."
      },
      "DryRun": {
        "name": "dryRun",
        "in": "query",
        "required": false,
        "schema": {
          "type": "boolean"
        },
        "description": "`true` to try the change without making it. Input, permissions, the organisation's plan and its rules are checked as for the real change, and the response is the one it would give, with `dryRun: true` and a `Dry-Run: true` header, but everything is undone. Nothing is audited, no emails are sent and Apps aren't asked. Only on operations with `x-adamrms-dry-run: true`; others answer DRY_RUN_NOT_AVAILABLE."
      }
    },
    "schemas": {
      "AssetImportCheckInput": {
        "type": "object",
        "properties": {
          "rows": {
            "minItems": 1,
            "maxItems": 2000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetImportRow"
            },
            "description": "The rows to check, up to 2000"
          },
          "firstRowNumber": {
            "default": 1,
            "description": "The spreadsheet row number of the first row, used when an issue points to another row. Defaults to 1",
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "createCategories": {
            "default": true,
            "description": "Create categories the rows name that don't exist. Defaults to true",
            "type": "boolean"
          },
          "createManufacturers": {
            "default": true,
            "description": "Create manufacturers the rows name that don't exist. Defaults to true",
            "type": "boolean"
          },
          "createLocations": {
            "default": true,
            "description": "Create locations the rows name that don't exist, with any missing locations above them in a path. Defaults to true",
            "type": "boolean"
          },
          "createAssetTypes": {
            "default": true,
            "description": "Create asset types the rows name that don't exist. Defaults to true",
            "type": "boolean"
          },
          "existingAssets": {
            "default": "SKIP",
            "description": "What to do with a row whose asset ID is already an asset's: `SKIP` it (the default, so importing the same file again adds nothing twice) or `UPDATE` the asset's location, own rate, value and mass, quantity and custom fields from it",
            "type": "string",
            "enum": ["SKIP", "UPDATE"]
          },
          "massUnit": {
            "default": "kg",
            "description": "The unit of the mass columns: `g`, `kg`, `t`, `oz` or `lb`. Defaults to kg",
            "type": "string",
            "enum": ["g", "kg", "t", "oz", "lb"]
          }
        },
        "required": ["rows"]
      },
      "AssetImportRunInput": {
        "type": "object",
        "properties": {
          "rows": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetImportRow"
            },
            "description": "The rows to import, up to 100. Send a longer spreadsheet a batch at a time: matching by name and asset ID means a later batch finds what an earlier one made"
          },
          "firstRowNumber": {
            "default": 1,
            "description": "The spreadsheet row number of the first row, used when an issue points to another row. Defaults to 1",
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "createCategories": {
            "default": true,
            "description": "Create categories the rows name that don't exist. Defaults to true",
            "type": "boolean"
          },
          "createManufacturers": {
            "default": true,
            "description": "Create manufacturers the rows name that don't exist. Defaults to true",
            "type": "boolean"
          },
          "createLocations": {
            "default": true,
            "description": "Create locations the rows name that don't exist, with any missing locations above them in a path. Defaults to true",
            "type": "boolean"
          },
          "createAssetTypes": {
            "default": true,
            "description": "Create asset types the rows name that don't exist. Defaults to true",
            "type": "boolean"
          },
          "existingAssets": {
            "default": "SKIP",
            "description": "What to do with a row whose asset ID is already an asset's: `SKIP` it (the default, so importing the same file again adds nothing twice) or `UPDATE` the asset's location, own rate, value and mass, quantity and custom fields from it",
            "type": "string",
            "enum": ["SKIP", "UPDATE"]
          },
          "massUnit": {
            "default": "kg",
            "description": "The unit of the mass columns: `g`, `kg`, `t`, `oz` or `lb`. Defaults to kg",
            "type": "string",
            "enum": ["g", "kg", "t", "oz", "lb"]
          }
        },
        "required": ["rows"]
      },
      "AssetCategoriesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return categories whose name contains this text (case-insensitive). Matches are returned with their children; a match whose parent does not match is returned at the top level",
            "type": "string",
            "maxLength": 255
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of top-level categories per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "position",
            "description": "Field to sort top-level categories by. Defaults to `position`",
            "type": "string",
            "enum": ["position", "name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          },
          "includeDeleted": {
            "default": false,
            "description": "Also return soft-deleted categories. Needs permission to view deleted categories",
            "type": "boolean"
          }
        }
      },
      "AssetCategoriesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Display name, e.g. 'Lighting' or 'Sound Equipment'"
          },
          "description": {
            "description": "What kinds of assets belong in this category",
            "type": "string",
            "maxLength": 1000
          },
          "icon": {
            "description": "Icon for the category: `tabler:<name>` for an icon from the Tabler library (https://tabler.io/icons, e.g. `tabler:bulb`), or `custom:<uuid>` for one the organisation uploaded",
            "type": "string",
            "pattern": "^(tabler:[a-z0-9-]{1,64}|custom:[A-Za-z0-9_-]{1,64})$"
          },
          "parentUUID": {
            "description": "UUID of the parent category. Omit for a top-level category. At most 3 levels deep (Parent > Child > Grandchild)",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["name"]
      },
      "AssetCategoriesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the category to update"
          },
          "name": {
            "description": "New display name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "icon": {
            "description": "New icon: `tabler:<name>` for an icon from the Tabler library (https://tabler.io/icons, e.g. `tabler:bulb`), or `custom:<uuid>` for one the organisation uploaded. Null to remove it, omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(tabler:[a-z0-9-]{1,64}|custom:[A-Za-z0-9_-]{1,64})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "parentUUID": {
            "description": "UUID of the new parent, or null to make the category top-level. Omit to leave unchanged. Moves that would nest deeper than 3 levels, or under the category's own descendant, are refused",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "AssetCategoriesReorderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the category to move"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "New position among its siblings, 0-based. Positions past the end move it to the end"
          }
        },
        "required": ["uuid", "sortOrder"]
      },
      "AssetCategoriesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the category to soft-delete"
          },
          "cascade": {
            "default": false,
            "description": "Also soft-delete every category nested under it. Without this, deleting a category that still has live children is refused",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "AttachmentsListInput": {
        "type": "object",
        "properties": {
          "recordType": {
            "type": "string",
            "enum": [
              "asset-category",
              "asset",
              "asset-type",
              "client",
              "client-contact",
              "location",
              "maintenance-job",
              "project",
              "manufacturer",
              "training-module",
              "member-certification",
              "payment",
              "wiki-page"
            ],
            "description": "The kind of record the files are attached to, e.g. `location`"
          },
          "recordUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the record the files are attached to"
          }
        },
        "required": ["recordType", "recordUuid"]
      },
      "AttachmentsCreateFolderInput": {
        "type": "object",
        "properties": {
          "recordType": {
            "type": "string",
            "enum": [
              "asset-category",
              "asset",
              "asset-type",
              "client",
              "client-contact",
              "location",
              "maintenance-job",
              "project",
              "manufacturer",
              "training-module",
              "member-certification",
              "payment",
              "wiki-page"
            ],
            "description": "The kind of record the files are attached to, e.g. `location`"
          },
          "recordUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the record the files are attached to"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Display name, e.g. 'Floor plans'"
          },
          "parentUUID": {
            "description": "UUID of the folder to create it in. Omit for the top level",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["recordType", "recordUuid", "name"]
      },
      "AttachmentsUpdateFolderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the folder to change"
          },
          "name": {
            "description": "New display name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "parentUUID": {
            "description": "UUID of the folder to move it into, or null for the top level. Omit to leave unchanged. It must be a folder on the same record, and not the folder itself or one inside it",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "AttachmentsDeleteFolderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the folder to delete. It must be empty"
          }
        },
        "required": ["uuid"]
      },
      "AttachmentsStartUploadInput": {
        "type": "object",
        "properties": {
          "recordType": {
            "type": "string",
            "enum": [
              "asset-category",
              "asset",
              "asset-type",
              "client",
              "client-contact",
              "location",
              "maintenance-job",
              "project",
              "manufacturer",
              "training-module",
              "member-certification",
              "payment",
              "wiki-page"
            ],
            "description": "The kind of record the files are attached to, e.g. `location`"
          },
          "recordUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the record the files are attached to"
          },
          "folderUUID": {
            "description": "UUID of the folder to put the file in. Omit for the top level",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Name of the file, with its extension, e.g. 'rigging-plan.pdf'"
          },
          "contentType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Content type of the file, e.g. `application/pdf`"
          },
          "sizeBytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "Exact size of the file in bytes"
          }
        },
        "required": [
          "recordType",
          "recordUuid",
          "fileName",
          "contentType",
          "sizeBytes"
        ]
      },
      "AttachmentsFinishUploadInput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The `uploadToken` from `attachments.start-upload`"
          },
          "parts": {
            "description": "For a multipart upload, every part that was sent. Omit for a single upload",
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "partNumber": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000,
                  "description": "Part number, 1-based"
                },
                "etag": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "description": "The `ETag` the part's PUT returned"
                }
              },
              "required": ["partNumber", "etag"]
            }
          }
        },
        "required": ["uploadToken"]
      },
      "AttachmentsAddLinkInput": {
        "type": "object",
        "properties": {
          "recordType": {
            "type": "string",
            "enum": [
              "asset-category",
              "asset",
              "asset-type",
              "client",
              "client-contact",
              "location",
              "maintenance-job",
              "project",
              "manufacturer",
              "training-module",
              "member-certification",
              "payment",
              "wiki-page"
            ],
            "description": "The kind of record the files are attached to, e.g. `location`"
          },
          "recordUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the record the files are attached to"
          },
          "folderUUID": {
            "description": "UUID of the folder to put the link in. Omit for the top level",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Display name of the link"
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri",
            "description": "The http or https URL to link to"
          }
        },
        "required": ["recordType", "recordUuid", "name", "url"]
      },
      "AttachmentsUpdateFileInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the file or link to change"
          },
          "name": {
            "description": "New display name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "recordUuid": {
            "description": "UUID of another record of the same kind to move it to, e.g. another location. It goes into `folderUUID` on that record, or the top level if that is omitted. Omit to keep it on its record",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "folderUUID": {
            "description": "UUID of the folder to move it into (on the record it ends up on), or null for the top level. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "AttachmentsDeleteFileInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the file or link to move to the trash"
          }
        },
        "required": ["uuid"]
      },
      "LocationsListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return locations whose name or address contains this text (case-insensitive). Matches are returned with the locations inside them; a match whose parent does not match is returned at the top level",
            "type": "string",
            "maxLength": 255
          },
          "clientUUID": {
            "description": "Only return locations that belong to this client. Like a search, a match whose parent does not match is returned at the top level",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of top-level locations per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort top-level locations by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          },
          "includeArchived": {
            "default": false,
            "description": "Also return archived locations",
            "type": "boolean"
          },
          "includeDeleted": {
            "default": false,
            "description": "Also return soft-deleted locations. Needs permission to view deleted locations",
            "type": "boolean"
          }
        }
      },
      "LocationsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the location"
          }
        },
        "required": ["uuid"]
      },
      "LocationsCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Display name, e.g. 'Main warehouse' or 'Shelf A'"
          },
          "address": {
            "description": "Postal address",
            "type": "string",
            "maxLength": 2000
          },
          "notes": {
            "description": "Free-text notes, e.g. access instructions",
            "type": "string",
            "maxLength": 10000
          },
          "parentUUID": {
            "description": "UUID of the location this one is inside. Omit for a top-level location",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "clientUUID": {
            "description": "UUID of the client this location belongs to. Omit if it belongs to none. Archived clients can't be picked",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["name"]
      },
      "LocationsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the location to update"
          },
          "name": {
            "description": "New display name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "address": {
            "description": "New address, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "description": "New notes, or null to clear them. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "parentUUID": {
            "description": "UUID of the location to move it inside, or null to make it top-level. Omit to leave unchanged. Moving a location inside itself or one of the locations inside it is refused",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "clientUUID": {
            "description": "UUID of the client it belongs to, or null for none. Omit to leave unchanged. Archived clients can't be picked",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "LocationsSetArchivedInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the location"
          },
          "archived": {
            "type": "boolean",
            "description": "True to archive the location, false to bring it back into use"
          }
        },
        "required": ["uuid", "archived"]
      },
      "LocationsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the location to soft-delete"
          },
          "cascade": {
            "default": false,
            "description": "Also soft-delete every location inside it. Without this, deleting a location that still has live locations inside it is refused",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "ClientsListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return clients whose name contains this text, or with a contact whose name, email or phone number contains it (case-insensitive), at any level of nesting",
            "type": "string",
            "maxLength": 255
          },
          "parentUUID": {
            "description": "Only return clients directly under this client, or only top-level clients if null. Omit to return clients at every level",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "includeArchived": {
            "default": false,
            "description": "Also return archived clients",
            "type": "boolean"
          },
          "includeDeleted": {
            "default": false,
            "description": "Also return soft-deleted clients. Needs permission to view deleted clients",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of clients per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort clients by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ClientsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client"
          }
        },
        "required": ["uuid"]
      },
      "ClientsTimelineInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client"
          },
          "cursor": {
            "description": "nextCursor from the previous page, to read further back. Leave out for the newest",
            "type": "string",
            "maxLength": 200
          },
          "limit": {
            "default": 30,
            "description": "How many entries to return, up to 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": ["uuid"]
      },
      "ClientsCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Name of the business or person, e.g. 'Acme Theatre Ltd'"
          },
          "website": {
            "description": "Website address, including https://",
            "type": "string",
            "maxLength": 500,
            "format": "uri"
          },
          "address": {
            "description": "Postal address; separate lines with newlines",
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "description": "Free-text notes about the client",
            "type": "string",
            "maxLength": 10000
          },
          "taxExempt": {
            "default": false,
            "description": "Projects for this client charge no tax. Defaults to false",
            "type": "boolean"
          },
          "isSupplier": {
            "default": false,
            "description": "The organisation also hires from this client, as a sub-hire supplier. Defaults to false",
            "type": "boolean"
          },
          "parentUUID": {
            "description": "UUID of the client to put this one under. Omit for a top-level client. At most 3 levels deep",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["name"]
      },
      "ClientsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client to update"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "website": {
            "description": "New website address, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "description": "New postal address, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "description": "New notes, or null to clear them. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxExempt": {
            "description": "Whether projects for this client charge no tax. Omit to leave unchanged",
            "type": "boolean"
          },
          "isSupplier": {
            "description": "Whether the client is also a sub-hire supplier. Omit to leave unchanged",
            "type": "boolean"
          },
          "parentUUID": {
            "description": "UUID of the new parent client, or null to make it top-level. Omit to leave unchanged. Moves that would nest deeper than 3 levels, or under the client's own sub-client, are refused",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ClientsArchiveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client"
          }
        },
        "required": ["uuid"]
      },
      "ClientsUnarchiveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client"
          }
        },
        "required": ["uuid"]
      },
      "ClientsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client to soft-delete"
          },
          "cascade": {
            "default": false,
            "description": "Also soft-delete every client nested under it. Without this, deleting a client that still has live sub-clients is refused",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "ClientContactsListInput": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client whose contacts to list"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of contacts per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort contacts by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["clientUUID"]
      },
      "ClientContactsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the contact"
          }
        },
        "required": ["uuid"]
      },
      "ClientContactsCreateInput": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client the person is at"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "The person's name, e.g. 'Sam Taylor'"
          },
          "jobTitle": {
            "description": "Their job title or role",
            "type": "string",
            "maxLength": 500
          },
          "email": {
            "description": "Their email address",
            "type": "string",
            "maxLength": 500,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "description": "Their phone number",
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "description": "Free-text notes about them",
            "type": "string",
            "maxLength": 10000
          }
        },
        "required": ["clientUUID", "name"]
      },
      "ClientContactsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the contact to update"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "jobTitle": {
            "description": "New job title, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "description": "New email address, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "description": "New phone number, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "description": "New notes, or null to clear them. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ClientContactsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the contact to remove"
          }
        },
        "required": ["uuid"]
      },
      "ManufacturersListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return manufacturers whose name contains this text (case-insensitive). Matches are returned with the manufacturers they own; a match whose parent does not match is returned at the top level",
            "type": "string",
            "maxLength": 255
          },
          "includeDeleted": {
            "default": false,
            "description": "Also return soft-deleted manufacturers. Needs permission to view deleted manufacturers",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of manufacturers per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort manufacturers by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ManufacturersCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Display name, e.g. 'ETC' or 'Shure'. Must not match another live manufacturer's name (ignoring case)"
          },
          "website": {
            "description": "The manufacturer's website, e.g. 'https://www.etcconnect.com'. A bare domain such as 'etcconnect.com' is saved with https://",
            "type": "string"
          },
          "notes": {
            "description": "Free-text notes about the manufacturer",
            "type": "string",
            "maxLength": 5000
          },
          "parentUUID": {
            "description": "UUID of the parent company, e.g. Harman's for JBL. Omit for a top-level manufacturer",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["name"]
      },
      "ManufacturersUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the manufacturer to update"
          },
          "name": {
            "description": "New display name. Omit to leave unchanged. Must not match another live manufacturer's name (ignoring case)",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "website": {
            "description": "New website, or null to clear it. Omit to leave unchanged",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "New notes, or null to clear them. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "parentUUID": {
            "description": "UUID of the new parent company, or null to make the manufacturer top-level. Omit to leave unchanged. A manufacturer cannot be put under itself or one it owns",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ManufacturersDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the manufacturer to soft-delete"
          }
        },
        "required": ["uuid"]
      },
      "AssetTypesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return types whose name, manufacturer or category contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "categoryUUID": {
            "description": "Only return types in this category or its subcategories",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "manufacturerUUID": {
            "description": "Only return types made by this manufacturer",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "includeDeleted": {
            "default": false,
            "description": "Also return soft-deleted types. Needs permission to view deleted asset types",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of asset types per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort asset types by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "AssetTypesSetTrackingInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset type"
          },
          "tracking": {
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"],
            "description": "How to track it from now on: INDIVIDUAL (one asset per unit, each with its own asset ID) or BULK (lots with a quantity)"
          },
          "preview": {
            "default": false,
            "description": "true to only work out what would happen and what stops it, changing nothing. Defaults to false",
            "type": "boolean"
          }
        },
        "required": ["uuid", "tracking"]
      },
      "AssetTypesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset type"
          }
        },
        "required": ["uuid"]
      },
      "AssetTypesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "The type's name, e.g. 'Source Four Jr 26°'"
          },
          "description": {
            "description": "A description of the type",
            "type": "string",
            "maxLength": 5000
          },
          "productLink": {
            "description": "Link to the manufacturer's product page. A bare domain is saved with https://",
            "type": "string"
          },
          "categoryUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset category. Must be a category with no subcategories"
          },
          "manufacturerUUID": {
            "description": "UUID of the manufacturer",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "tracking": {
            "default": "INDIVIDUAL",
            "description": "`INDIVIDUAL`: each unit is its own asset with its own asset IDs (fixtures, desks, radios). `BULK`: stock is held as lots with a quantity (cables, clamps, bulbs). Defaults to INDIVIDUAL",
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"]
          },
          "usage": {
            "default": "RENTAL",
            "description": "`RENTAL`: hired out and returned. `CONSUMABLE`: used up on projects and sold (tape, batteries). Consumables must be tracked in BULK. Defaults to RENTAL",
            "type": "string",
            "enum": ["RENTAL", "CONSUMABLE"]
          },
          "mass": {
            "description": "Mass of one unit, in `massUnit`",
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "massUnit": {
            "default": "kg",
            "description": "The unit `mass` is given in: `g`, `kg`, `t`, `oz` or `lb`. Defaults to kg",
            "type": "string",
            "enum": ["g", "kg", "t", "oz", "lb"]
          },
          "rate": {
            "description": "Hire rate of one unit (or sale price, for a consumable) in the smallest currency unit (e.g. pence). How the hire's length multiplies it is set by the price structure",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure, or null for the organisation's default. Omit for the default",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at. Omit for the default",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "value": {
            "description": "Replacement value of one unit, in the smallest currency unit",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "turnaroundHours": {
            "default": 0,
            "description": "Hours a unit stays unavailable after a project ends, while it's checked, cleaned or recharged, such as 24 for a hazer. A unit back from one project can't go out on the next until then. 0 for none. At most 720. Defaults to 0",
            "type": "integer",
            "minimum": 0,
            "maximum": 720
          },
          "showOnPublicSite": {
            "description": "Whether the public site's catalogue lists it, when the catalogue shows its category. Defaults to true",
            "type": "boolean"
          },
          "thumbnail": {
            "description": "The type's main thumbnail, shown wherever the type is: a PNG, JPEG or WebP image of at most 128 KB as a base64 `data:` URL. A square image works best",
            "type": "string",
            "maxLength": 174794,
            "pattern": "^data:(image\\/(?:png|jpeg|webp));base64,([A-Za-z0-9+/]+={0,2})$"
          },
          "customFields": {
            "description": "Values of custom fields set on asset types, by field UUID",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/CustomFieldValue"
            }
          },
          "customFieldUUIDs": {
            "description": "Custom fields used only by chosen asset types (appliesTo TYPES) that this type should use too, e.g. ones made for it. Fields used by every type are already on it",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["name", "categoryUUID"]
      },
      "AssetTypesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset type to update"
          },
          "name": {
            "description": "The type's name, e.g. 'Source Four Jr 26°'. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "productLink": {
            "description": "New product link, or null to clear it. Omit to leave unchanged",
            "type": ["string", "null"]
          },
          "categoryUUID": {
            "description": "UUID of the asset category. Must be a category with no subcategories. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "manufacturerUUID": {
            "description": "UUID of the manufacturer, or null for none. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "tracking": {
            "description": "`INDIVIDUAL`: each unit is its own asset with its own asset IDs (fixtures, desks, radios). `BULK`: stock is held as lots with a quantity (cables, clamps, bulbs). Omit to leave unchanged",
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"]
          },
          "usage": {
            "description": "`RENTAL`: hired out and returned. `CONSUMABLE`: used up on projects and sold (tape, batteries). Consumables must be tracked in BULK. Omit to leave unchanged",
            "type": "string",
            "enum": ["RENTAL", "CONSUMABLE"]
          },
          "mass": {
            "description": "Mass of one unit in `massUnit`, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "massUnit": {
            "description": "The unit `mass` is given in. Required with `mass`; on its own, shows the stored mass in this unit",
            "type": "string",
            "enum": ["g", "kg", "t", "oz", "lb"]
          },
          "rate": {
            "description": "Hire rate of one unit (or sale price, for a consumable) in the smallest currency unit (e.g. pence). How the hire's length multiplies it is set by the price structure, or null if not for hire. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure, or null for the organisation's default. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at, or null for the default. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "value": {
            "description": "Replacement value of one unit, in the smallest currency unit, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "turnaroundHours": {
            "description": "Hours a unit stays unavailable after a project ends, while it's checked, cleaned or recharged, such as 24 for a hazer. A unit back from one project can't go out on the next until then. 0 for none. At most 720. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 720
          },
          "showOnPublicSite": {
            "description": "Whether the public site's catalogue lists it, when the catalogue shows its category. Defaults to true. Omit to leave unchanged",
            "type": "boolean"
          },
          "thumbnail": {
            "description": "The type's main thumbnail, shown wherever the type is: a PNG, JPEG or WebP image of at most 128 KB as a base64 `data:` URL. A square image works best, or null to remove it (the next thumbnail becomes the main one). Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 174794,
                "pattern": "^data:(image\\/(?:png|jpeg|webp));base64,([A-Za-z0-9+/]+={0,2})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "customFields": {
            "description": "Custom field values to change, by field UUID. Fields left out keep their value; null clears one",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/CustomFieldValue"
            }
          }
        },
        "required": ["uuid"]
      },
      "AssetTypesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset type to soft-delete"
          }
        },
        "required": ["uuid"]
      },
      "AssetTypesAddThumbnailInput": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset type to add the thumbnail to"
          },
          "thumbnail": {
            "type": "string",
            "maxLength": 174794,
            "pattern": "^data:(image\\/(?:png|jpeg|webp));base64,([A-Za-z0-9+/]+={0,2})$",
            "description": "The thumbnail: a PNG, JPEG or WebP image of at most 128 KB as a base64 `data:` URL. A square image works best"
          },
          "main": {
            "default": false,
            "description": "Make it the type's main thumbnail. Defaults to false, which adds it last. A type's first thumbnail is always its main one",
            "type": "boolean"
          }
        },
        "required": ["assetTypeUUID", "thumbnail"]
      },
      "AssetTypesRemoveThumbnailInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the thumbnail, from the type's `thumbnailUUIDs`"
          }
        },
        "required": ["uuid"]
      },
      "AssetTypesSetMainThumbnailInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the thumbnail, from the type's `thumbnailUUIDs`"
          }
        },
        "required": ["uuid"]
      },
      "AccessoriesGetInput": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset type"
          }
        },
        "required": ["assetTypeUUID"]
      },
      "AccessoriesSetInput": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset type to set accessories of"
          },
          "accessories": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetTypeUUID": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "UUID of the accessory's asset type. Each type can appear once, and not the asset type itself"
                },
                "quantity": {
                  "default": 1,
                  "description": "How many of the accessory go out with one of the asset type, 1 to 10000. Defaults to 1",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                },
                "mode": {
                  "default": "MANDATORY",
                  "description": "How the accessory goes out with the asset type: MANDATORY (always, and it can't be left out), DEFAULT (unless it is taken out of the booking) or OPTIONAL (only if it is added, as an extra). Defaults to MANDATORY",
                  "type": "string",
                  "enum": ["MANDATORY", "DEFAULT", "OPTIONAL"]
                }
              },
              "required": ["assetTypeUUID"]
            },
            "description": "Every accessory of the asset type, in order, replacing what it had (up to 50). An empty list removes them all. Accessories can have accessories, up to 4 levels counting the asset type"
          }
        },
        "required": ["assetTypeUUID", "accessories"]
      },
      "PackagesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return packages whose name contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "assetTypeUUID": {
            "description": "Only return the packages this asset type is in",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of packages per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort packages by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "PackagesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the package"
          }
        },
        "required": ["uuid"]
      },
      "PackagesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Display name, such as 'Small PA package'"
          },
          "description": {
            "description": "What the package is for, such as 'Speeches and background music for up to 100 people'",
            "type": "string",
            "maxLength": 5000
          },
          "rate": {
            "description": "Hire rate of the whole package in the smallest currency unit (such as pence). How the hire's length multiplies it is set by the price structure. Omit if it has no rate",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that sets how the length of a hire multiplies the rate. Null for the organisation's default. Omit for the default",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at. Omit for the default",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "showOnPublicSite": {
            "description": "Whether the public site's catalogue lists it, when the catalogue shows packages. Defaults to true",
            "type": "boolean"
          },
          "contents": {
            "description": "The asset types in the package, in order (up to 50)",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetTypeUUID": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "UUID of the asset type. Each type can appear once"
                },
                "quantity": {
                  "default": 1,
                  "description": "How many of the asset type go out with one package, 1 to 10000. Defaults to 1",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                },
                "mode": {
                  "default": "MANDATORY",
                  "description": "How the asset type goes out with the package: MANDATORY (always, and it can't be left out), DEFAULT (unless it is taken out of the booking) or OPTIONAL (only if it is added, as an extra). Defaults to MANDATORY",
                  "type": "string",
                  "enum": ["MANDATORY", "DEFAULT", "OPTIONAL"]
                }
              },
              "required": ["assetTypeUUID"]
            }
          }
        },
        "required": ["name"]
      },
      "PackagesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the package to update"
          },
          "name": {
            "description": "Display name, such as 'Small PA package'. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "rate": {
            "description": "Hire rate of the whole package in the smallest currency unit (such as pence). How the hire's length multiplies it is set by the price structure, or null for no rate. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that sets how the length of a hire multiplies the rate. Null for the organisation's default. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at, or null for the default. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "showOnPublicSite": {
            "description": "Whether the public site's catalogue lists it, when the catalogue shows packages. Omit to leave unchanged",
            "type": "boolean"
          },
          "contents": {
            "description": "Every asset type in the package, in order, replacing what it had (up to 50). Omit to leave unchanged",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetTypeUUID": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "UUID of the asset type. Each type can appear once"
                },
                "quantity": {
                  "default": 1,
                  "description": "How many of the asset type go out with one package, 1 to 10000. Defaults to 1",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                },
                "mode": {
                  "default": "MANDATORY",
                  "description": "How the asset type goes out with the package: MANDATORY (always, and it can't be left out), DEFAULT (unless it is taken out of the booking) or OPTIONAL (only if it is added, as an extra). Defaults to MANDATORY",
                  "type": "string",
                  "enum": ["MANDATORY", "DEFAULT", "OPTIONAL"]
                }
              },
              "required": ["assetTypeUUID"]
            }
          }
        },
        "required": ["uuid"]
      },
      "PackagesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the package to delete. The asset types in it are not changed"
          }
        },
        "required": ["uuid"]
      },
      "CalendarProjectsInput": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
          },
          "to": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
          },
          "assetTypeUUID": {
            "description": "Only projects with this asset type on them",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "assetUUID": {
            "description": "Only projects this asset is allocated to",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "venueUUID": {
            "description": "Only projects at this location",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["from", "to"]
      },
      "CalendarMineInput": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
          },
          "to": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
          }
        },
        "required": ["from", "to"]
      },
      "CalendarMemberInput": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "First day to show, such as `2027-06-01`, in the organisation's timezone"
          },
          "to": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Last day to show, such as `2027-06-30`. At most 1100 days after `from`"
          },
          "memberUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the member whose calendar to list"
          }
        },
        "required": ["from", "to", "memberUUID"]
      },
      "CalendarSettingsGetInput": {
        "type": "object",
        "properties": {}
      },
      "CalendarSettingsUpdateInput": {
        "type": "object",
        "properties": {
          "showStatus": {
            "description": "Show each project's status after its name. Omit to leave unchanged",
            "type": "boolean"
          },
          "showSubProjects": {
            "description": "Show sub-projects with dates of their own as entries of their own. Omit to leave unchanged",
            "type": "boolean"
          },
          "defaultView": {
            "description": "How the calendar opens: `month`, `week` or `list`. Omit to leave unchanged",
            "type": "string",
            "enum": ["month", "week", "list"]
          },
          "useWeekLabels": {
            "description": "Show week labels in place of week numbers. Omit to leave unchanged",
            "type": "boolean"
          },
          "weekLabels": {
            "description": "Every week label, replacing the ones there are. An empty list removes them all. Omit to leave unchanged",
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarWeekLabel"
            }
          }
        }
      },
      "CalendarFeedsGetInput": {
        "type": "object",
        "properties": {}
      },
      "CalendarFeedsCreateInput": {
        "type": "object",
        "properties": {
          "scope": {
            "default": "MINE",
            "description": "`MINE` (the default) for the caller's own projects, or `ALL` for every project on the organisation's calendar",
            "type": "string",
            "enum": ["MINE", "ALL"]
          }
        }
      },
      "CalendarFeedsRevokeInput": {
        "type": "object",
        "properties": {}
      },
      "DashboardGetInput": {
        "type": "object",
        "properties": {}
      },
      "DashboardSetWidgetsInput": {
        "type": "object",
        "properties": {
          "hidden": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "my-calendar",
                "projects-today",
                "project-shortages",
                "my-maintenance",
                "maintenance-open",
                "inspections-due",
                "inventory-total",
                "inventory-value",
                "members",
                "storage"
              ],
              "description": "A widget: `my-calendar`, `projects-today`, `project-shortages`, `my-maintenance`, `maintenance-open`, `inspections-due`, `inventory-total`, `inventory-value`, `members` or `storage`"
            },
            "description": "Every widget to hide from the caller's dashboard. The rest they can see are shown, and so are widgets added later"
          }
        },
        "required": ["hidden"]
      },
      "WikiPagesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return pages whose name or description contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "parentUUID": {
            "description": "Only return the sub-pages of this page. Null for top-level pages only. Omit for pages at every level",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "inMenu": {
            "description": "True for only the pages listed in the side menu",
            "type": "boolean"
          },
          "archived": {
            "default": "LIVE",
            "description": "`LIVE` (the default) for pages that aren't archived, `ARCHIVED` for archived pages only, `ALL` for both",
            "type": "string",
            "enum": ["LIVE", "ARCHIVED", "ALL"]
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of pages per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "menuOrder",
            "description": "Field to sort pages by. Defaults to `menuOrder`",
            "type": "string",
            "enum": ["name", "menuOrder", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "WikiPagesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page"
          },
          "revision": {
            "description": "Number of an earlier revision to return. Omit for the newest",
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          }
        },
        "required": ["uuid"]
      },
      "WikiPagesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The page's title, such as 'Loading the van'"
          },
          "description": {
            "description": "A sentence about what the page is for",
            "type": "string",
            "maxLength": 5000
          },
          "icon": {
            "description": "The page's icon: `tabler:<name>` for an icon from the Tabler library (https://tabler.io/icons, e.g. `tabler:book`), or `custom:<uuid>` for one the organisation uploaded",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(tabler:[a-z0-9-]{1,64}|custom:[A-Za-z0-9_-]{1,64})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "parentUUID": {
            "description": "UUID of the page to put it under. Omit for a top-level page",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "showInMenu": {
            "default": false,
            "description": "True to list the page in the side menu. Defaults to false",
            "type": "boolean"
          },
          "showSubPages": {
            "default": true,
            "description": "True to list the page's sub-pages under its cards. Defaults to true",
            "type": "boolean"
          },
          "showFiles": {
            "default": true,
            "description": "True to list the page's files under its cards. Defaults to true",
            "type": "boolean"
          },
          "roleUUIDs": {
            "default": [],
            "description": "UUIDs of the roles whose members can see the page. Omit, or pass an empty list, to let every member see it",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "cards": {
            "default": [],
            "description": "The page's cards, in order",
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WikiCard"
            }
          },
          "changelog": {
            "description": "A note about this first version, such as 'First draft'",
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": ["name"]
      },
      "WikiPagesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page to update"
          },
          "name": {
            "description": "New title. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "icon": {
            "description": "New icon, or null to remove it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(tabler:[a-z0-9-]{1,64}|custom:[A-Za-z0-9_-]{1,64})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "parentUUID": {
            "description": "UUID of the page to move it under, or null to make it a top-level page. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "showInMenu": {
            "description": "Whether the page is listed in the side menu. Omit to leave unchanged",
            "type": "boolean"
          },
          "showSubPages": {
            "description": "Whether the page lists its sub-pages. Omit to leave unchanged",
            "type": "boolean"
          },
          "showFiles": {
            "description": "Whether the page lists its files. Omit to leave unchanged",
            "type": "boolean"
          },
          "roleUUIDs": {
            "description": "UUIDs of the roles whose members can see the page, replacing the current ones. An empty list lets every member see it. Omit to leave unchanged",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "archived": {
            "description": "True to archive the page, false to bring it back. Omit to leave unchanged",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "WikiPagesMoveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page to move"
          },
          "direction": {
            "type": "string",
            "enum": ["UP", "DOWN"],
            "description": "UP to swap it with the page before it among its sibling pages, DOWN with the page after it. New pages go to the end"
          }
        },
        "required": ["uuid", "direction"]
      },
      "WikiPagesSaveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page"
          },
          "cards": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WikiCard"
            },
            "description": "The page's cards, in order. They replace the current ones, as a new revision"
          },
          "changelog": {
            "description": "A note about what changed, such as 'Added the new van'",
            "type": "string",
            "maxLength": 1000
          },
          "baseRevision": {
            "description": "The revision these changes were made to. If someone has saved a newer one since, the save is refused rather than overwriting their changes. Omit to save regardless",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": ["uuid", "cards"]
      },
      "WikiPagesListRevisionsInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of revisions per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "revision",
            "description": "Field to sort revisions by. Defaults to `revision`",
            "type": "string",
            "enum": ["revision"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["uuid"]
      },
      "WikiPagesRestoreRevisionInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page"
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "Number of the revision whose content to bring back"
          },
          "changelog": {
            "description": "A note for the new revision. Defaults to 'Restored revision <number>'",
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": ["uuid", "revision"]
      },
      "WikiPagesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page to delete. A page with sub-pages can't be deleted until they are moved or deleted"
          }
        },
        "required": ["uuid"]
      },
      "WikiPagesRecordViewInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page that was viewed"
          },
          "source": {
            "default": "WEB",
            "description": "Where it was viewed: `WEB` (the default) on its own page, `APP` in a mobile app, `DASHBOARD` as a role's dashboard",
            "type": "string",
            "enum": ["WEB", "APP", "DASHBOARD"]
          }
        },
        "required": ["uuid"]
      },
      "WikiPagesViewStatsInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page"
          },
          "days": {
            "default": 30,
            "description": "How many days to count back from today, at most 365. Defaults to 30",
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          }
        },
        "required": ["uuid"]
      },
      "WikiPagesListViewsInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the page"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of views per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "viewedAt",
            "description": "Field to sort views by. Defaults to `viewedAt`",
            "type": "string",
            "enum": ["viewedAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["uuid"]
      },
      "WikiPagesListDashboardsInput": {
        "type": "object",
        "properties": {}
      },
      "WikiPagesSetDashboardInput": {
        "type": "object",
        "properties": {
          "roleUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the role"
          },
          "pageUUID": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "UUID of the wiki page to show the role's members in place of the dashboard, or null for the usual dashboard. The page must be visible to the role"
          }
        },
        "required": ["roleUUID", "pageUUID"]
      },
      "WikiPagesGetDashboardInput": {
        "type": "object",
        "properties": {}
      },
      "AssetGroupsListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return groups whose name contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "assetUUID": {
            "description": "Only return the groups this asset is in",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of asset groups per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort asset groups by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "AssetGroupsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset group"
          }
        },
        "required": ["uuid"]
      },
      "AssetGroupsCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Display name, such as 'Touring rig A'"
          },
          "description": {
            "description": "What the group is for, such as 'Everything that goes on the Tour A truck'",
            "type": "string",
            "maxLength": 5000
          },
          "personal": {
            "default": false,
            "description": "True to make a personal group that only the caller can see. Defaults to false: a group shared with the organisation",
            "type": "boolean"
          }
        },
        "required": ["name"]
      },
      "AssetGroupsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset group to update"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "personal": {
            "description": "True to make the group personal to the caller, false to share it with the organisation. Omit to leave unchanged",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "AssetGroupsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset group to delete. The assets in it are not deleted"
          }
        },
        "required": ["uuid"]
      },
      "AssetGroupsAddAssetsInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset group"
          },
          "assetUUIDs": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUIDs of the assets, 1 to 100 at a time"
          }
        },
        "required": ["uuid", "assetUUIDs"]
      },
      "AssetGroupsRemoveAssetsInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset group"
          },
          "assetUUIDs": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUIDs of the assets, 1 to 100 at a time"
          }
        },
        "required": ["uuid", "assetUUIDs"]
      },
      "AssetGroupsWatchInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset group"
          }
        },
        "required": ["uuid"]
      },
      "AssetGroupsUnwatchInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset group"
          }
        },
        "required": ["uuid"]
      },
      "NotificationsSendInput": {
        "type": "object",
        "properties": {
          "recipientUUIDs": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUIDs of the members to email, 1 to 50. Anyone who isn't a member, can't see the record, or has turned these emails off is skipped"
          },
          "subject": {
            "type": "string",
            "minLength": 1,
            "maxLength": 150,
            "description": "What the email is about, such as 'Delivery due tomorrow'. The organisation's name is added to it"
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000,
            "description": "The email's text, as plain text. A blank line starts a new paragraph. Not Markdown or HTML"
          },
          "record": {
            "description": "A record the email is about. The email links to it, and only members who can see it are emailed",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "asset-category",
                  "asset",
                  "asset-type",
                  "client",
                  "client-contact",
                  "location",
                  "maintenance-job",
                  "project",
                  "manufacturer",
                  "training-module",
                  "member-certification",
                  "payment",
                  "wiki-page"
                ],
                "description": "The kind of record: `asset-category` (an asset category), `asset` (an asset (one unit, or one bulk lot)), `asset-type` (an asset type (a catalogue entry)), `client` (a client), `client-contact` (a person at a client), `location` (a location), `maintenance-job` (a maintenance job (a fault or piece of work on assets)), `project` (a project (an event, show or hire)), `manufacturer` (a manufacturer of assets), `training-module` (a training module, whose files are the images in its steps), `member-certification` (a certification a member holds, whose files are photos or PDFs of the card), `payment` (a payment, refund or deposit on a project, whose files are receipts and remittances), `wiki-page` (a page in the organisation's wiki)"
              },
              "uuid": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "UUID of the record"
              }
            },
            "required": ["type", "uuid"]
          }
        },
        "required": ["recipientUUIDs", "subject", "message"]
      },
      "LabelTemplatesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return templates whose name contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "subject": {
            "description": "Only return templates for assets, or for locations",
            "type": "string",
            "enum": ["ASSET", "LOCATION"]
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of label templates per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort label templates by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "LabelTemplatesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the label template"
          }
        },
        "required": ["uuid"]
      },
      "LabelTemplatesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Display name, such as 'Asset label 62mm'"
          },
          "description": {
            "description": "What it's for, such as 'For cases, on the 62mm roll'",
            "type": "string",
            "maxLength": 5000
          },
          "subject": {
            "default": "ASSET",
            "description": "Whether the labels are for assets or locations",
            "type": "string",
            "enum": ["ASSET", "LOCATION"]
          },
          "width": {
            "type": "number",
            "minimum": 5,
            "maximum": 300,
            "description": "Width of one label, in millimetres"
          },
          "height": {
            "type": "number",
            "minimum": 5,
            "maximum": 300,
            "description": "Height of one label, in millimetres"
          },
          "sheet": {
            "default": null,
            "description": "How labels sit on a sheet, such as an A4 sticker sheet. Null for a roll or tape",
            "anyOf": [
              {
                "$ref": "#/components/schemas/LabelSheet"
              },
              {
                "type": "null"
              }
            ]
          },
          "elements": {
            "default": [],
            "description": "What's drawn on each label, from the bottom layer up (up to 40)",
            "maxItems": 40,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelElement"
            }
          }
        },
        "required": ["name", "width", "height"]
      },
      "LabelTemplatesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template to update"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "width": {
            "description": "New width. Omit to leave unchanged",
            "type": "number",
            "minimum": 5,
            "maximum": 300
          },
          "height": {
            "description": "New height. Omit to leave unchanged",
            "type": "number",
            "minimum": 5,
            "maximum": 300
          },
          "sheet": {
            "description": "New sheet layout, or null for a roll or tape. Omit to leave unchanged",
            "anyOf": [
              {
                "$ref": "#/components/schemas/LabelSheet"
              },
              {
                "type": "null"
              }
            ]
          },
          "elements": {
            "description": "Every element, replacing the ones there now. Omit to leave unchanged",
            "maxItems": 40,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelElement"
            }
          }
        },
        "required": ["uuid"]
      },
      "LabelTemplatesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template to delete"
          }
        },
        "required": ["uuid"]
      },
      "AssetsListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return assets with an asset ID, type name or custom field text containing this (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "assetTypeUUID": {
            "description": "Only return assets of this type",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "categoryUUID": {
            "description": "Only return assets whose type is in this category or its subcategories",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "storageLocationUUID": {
            "description": "Only return assets kept at this location or the locations inside it",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "parentUUID": {
            "description": "Only return assets kept directly in this asset",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "manufacturerUUID": {
            "description": "Only return assets whose type is made by this manufacturer or a manufacturer it owns",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "groupUUID": {
            "description": "Only return assets in this asset group. Another member's personal group matches no assets",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "uuids": {
            "description": "Only return these assets, by UUID (up to 100). UUIDs that aren't assets are ignored",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "includeArchived": {
            "default": false,
            "description": "Also return archived assets",
            "type": "boolean"
          },
          "includeDeleted": {
            "default": false,
            "description": "Also return soft-deleted assets. Needs permission to view deleted assets",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of assets per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "assetId",
            "description": "Field to sort assets by. Defaults to `assetId`",
            "type": "string",
            "enum": ["assetId", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "AssetsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          }
        },
        "required": ["uuid"]
      },
      "AssetsCreateInput": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset type"
          },
          "count": {
            "default": 1,
            "description": "How many assets to create, each with its own asset ID (1 to 100). For a bulk type this is the number of lots",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "assetIDs": {
            "description": "The asset IDs to give the new assets, one each, in order. Must have `count` values. Omit to number them from `startingID` or the organisation's ID sequence",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          "startingID": {
            "description": "The first asset's ID; later ones count up from its last number, keeping its padding (E-009, E-010, ...). Omit to use the organisation's ID sequence",
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "symbology": {
            "description": "What the new asset IDs are printed as. Omit for not printed as a barcode",
            "type": "string",
            "enum": [
              "QR_CODE",
              "CODE_128",
              "CODE_39",
              "CODE_93",
              "EAN_8",
              "EAN_13"
            ]
          },
          "quantity": {
            "description": "Bulk types only: how many items each new lot holds. Defaults to 1. Recorded as the opening balance",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "mass": {
            "description": "Mass of one item in `massUnit`, overriding the type's",
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "massUnit": {
            "default": "kg",
            "description": "The unit `mass` is given in: `g`, `kg`, `t`, `oz` or `lb`. Defaults to kg",
            "type": "string",
            "enum": ["g", "kg", "t", "oz", "lb"]
          },
          "value": {
            "description": "Replacement value of one item in the smallest currency unit, overriding the type's",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "rateOverride": {
            "description": "Hire rate of one item in the smallest currency unit, overriding the type's",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "priceStructureOverrideUUID": {
            "description": "UUID of the price structure, overriding the type's (and the organisation default)",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "storageLocationUUID": {
            "description": "UUID of the location it is kept at when not out",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "parentUUID": {
            "description": "UUID of the asset it is kept in (a case, a rack). A case can't end up inside itself",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "linkKind": {
            "default": "DEFAULT",
            "description": "How it goes with its case: `PERMANENT` (always, and can't be booked alone) or `DEFAULT` (unless left out). Defaults to DEFAULT",
            "type": "string",
            "enum": ["PERMANENT", "DEFAULT"]
          },
          "customFields": {
            "description": "Custom field values set on the asset, by field UUID. A field set on both the type and the asset overrides the type's value. Every new asset gets the same values",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/CustomFieldValue"
            }
          }
        },
        "required": ["assetTypeUUID"]
      },
      "AssetsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset to update"
          },
          "mass": {
            "description": "Mass of one item in `massUnit`, overriding the type's, or null to use the type's. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "massUnit": {
            "description": "The unit `mass` is given in. Required with `mass`",
            "type": "string",
            "enum": ["g", "kg", "t", "oz", "lb"]
          },
          "value": {
            "description": "Replacement value of one item in the smallest currency unit, overriding the type's, or null to use the type's. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "rateOverride": {
            "description": "Hire rate of one item in the smallest currency unit, overriding the type's, or null to use the type's. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "priceStructureOverrideUUID": {
            "description": "UUID of the price structure, overriding the type's (and the organisation default), or null to use the type's. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "storageLocationUUID": {
            "description": "UUID of the location it is kept at when not out, or null for none. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "parentUUID": {
            "description": "UUID of the asset it is kept in (a case, a rack). A case can't end up inside itself, or null to take it out of its case. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "linkKind": {
            "description": "How it goes with its case: `PERMANENT` (always, and can't be booked alone) or `DEFAULT` (unless left out). Defaults to DEFAULT. Only with a case. Omit to leave unchanged",
            "type": "string",
            "enum": ["PERMANENT", "DEFAULT"]
          },
          "customFields": {
            "description": "Custom field values to change, by field UUID. Fields left out keep their value; null clears one (so a field set on both falls back to the type's)",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/CustomFieldValue"
            }
          }
        },
        "required": ["uuid"]
      },
      "AssetsArchiveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset to archive"
          },
          "reason": {
            "description": "Why, e.g. 'Sold to Acme' or 'Lost on tour'",
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": ["uuid"]
      },
      "AssetsUnarchiveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          }
        },
        "required": ["uuid"]
      },
      "AssetsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          }
        },
        "required": ["uuid"]
      },
      "AssetsRestoreInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          }
        },
        "required": ["uuid"]
      },
      "AssetIdsAddInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset to add the ID to"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The ID as printed or scanned. Must not be a live ID of any asset (ignoring case)"
          },
          "symbology": {
            "description": "What it is printed as. Omit for not a barcode",
            "type": "string",
            "enum": [
              "QR_CODE",
              "CODE_128",
              "CODE_39",
              "CODE_93",
              "EAN_8",
              "EAN_13"
            ]
          },
          "makePrimary": {
            "default": false,
            "description": "Make it the asset's primary ID, e.g. after re-labelling. The old one still scans",
            "type": "boolean"
          },
          "notes": {
            "description": "Notes on the ID, e.g. 'Manufacturer barcode'",
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": ["assetUUID", "value"]
      },
      "AssetIdsRemoveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset ID record"
          }
        },
        "required": ["uuid"]
      },
      "AssetIdsSetPrimaryInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset ID record"
          }
        },
        "required": ["uuid"]
      },
      "AssetIdsLookupInput": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "An asset ID as printed or scanned"
          }
        },
        "required": ["value"]
      },
      "AssetIdsReserveInput": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200,
            "description": "How many asset IDs to reserve, up to 200. They come from the organisation's sequence, which moves past them"
          }
        },
        "required": ["count"]
      },
      "AssetsAdjustStockInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the lot"
          },
          "delta": {
            "type": "integer",
            "minimum": -1000000,
            "maximum": 1000000,
            "description": "How many items to add (positive) or take away (negative). The lot can't go below 0"
          },
          "reason": {
            "type": "string",
            "enum": [
              "PURCHASE",
              "FOUND",
              "WRITE_OFF",
              "CONSUMED",
              "COUNT_CORRECTION"
            ],
            "description": "Why: `PURCHASE`, `FOUND`, `WRITE_OFF` (lost or broken), `CONSUMED` (used up) or `COUNT_CORRECTION` (a stock count found a different number)"
          },
          "note": {
            "description": "A note on the change",
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": ["uuid", "delta", "reason"]
      },
      "AssetsStockHistoryInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the lot"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of stock movements per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort stock movements by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["uuid"]
      },
      "AssetSettingsGetInput": {
        "type": "object",
        "properties": {}
      },
      "AssetSettingsUpdateInput": {
        "type": "object",
        "properties": {
          "idPrefix": {
            "description": "What new asset IDs start with, e.g. `A-` gives A-0001. May be empty. Omit to leave unchanged",
            "type": "string",
            "maxLength": 20,
            "allOf": [
              {
                "pattern": "^\\S*$"
              },
              {
                "pattern": "\\D$|^$"
              }
            ]
          },
          "idPadLength": {
            "description": "How many digits new asset IDs' numbers are padded to, e.g. 4 gives A-0001. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "idNextNumber": {
            "description": "The number the next generated asset ID gets. Numbers already used are skipped. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000000
          }
        }
      },
      "LocalisationSettingsGetInput": {
        "type": "object",
        "properties": {}
      },
      "LocalisationSettingsUpdateInput": {
        "type": "object",
        "properties": {
          "currency": {
            "description": "ISO 4217 code of the currency the organisation hires in, e.g. `GBP`. Rates and values are stored in its smallest unit (pence, cents). Changing it doesn't convert amounts already entered, so it can't change once projects have prices, quotes, invoices or payments. Omit to leave unchanged",
            "type": "string",
            "enum": [
              "GBP",
              "USD",
              "EUR",
              "AUD",
              "CAD",
              "CHF",
              "CNY",
              "JPY",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BGN",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BYN",
              "BZD",
              "CDF",
              "CLP",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLE",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XCG",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ]
          },
          "timezone": {
            "description": "IANA name of the organisation's timezone, e.g. `Europe/London`. Dates on projects and documents are in this timezone. Omit to leave unchanged",
            "type": "string"
          },
          "documentLanguage": {
            "description": "Language of documents written for clients, such as quotes and invoices: one of `en`, `fr`, `es`, `de`, `it`, `pt`, `nl`. Omit to leave unchanged",
            "type": "string",
            "enum": ["en", "fr", "es", "de", "it", "pt", "nl"]
          },
          "unitSystem": {
            "description": "How masses are shown: `METRIC` (g, kg, t), `IMPERIAL_UK` (oz, lb, 2,240 lb ton) or `IMPERIAL_US` (oz, lb, 2,000 lb ton). Omit to leave unchanged",
            "type": "string",
            "enum": ["METRIC", "IMPERIAL_UK", "IMPERIAL_US"]
          }
        }
      },
      "SecuritySettingsGetInput": {
        "type": "object",
        "properties": {}
      },
      "SecuritySettingsUpdateInput": {
        "type": "object",
        "properties": {
          "idleTimeoutMinutes": {
            "description": "Sign members out after this many minutes without using the organisation, such as on a shared warehouse computer: one of 15, 30, 60, 120, 240, 480, or null for never. Using the dashboard or another organisation doesn't count as using this one. Omit to leave unchanged",
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 15
                  },
                  {
                    "type": "number",
                    "const": 30
                  },
                  {
                    "type": "number",
                    "const": 60
                  },
                  {
                    "type": "number",
                    "const": 120
                  },
                  {
                    "type": "number",
                    "const": 240
                  },
                  {
                    "type": "number",
                    "const": 480
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "mfaRequiredRoleUUIDs": {
            "description": "UUIDs of the roles whose members must use two-factor authentication. Members with these roles who haven't set it up can't use the organisation until they do. Empty for none. Omit to leave unchanged",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        }
      },
      "BackupsGetScheduleInput": {
        "type": "object",
        "properties": {}
      },
      "BackupsSetScheduleInput": {
        "type": "object",
        "properties": {
          "hourUTC": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23,
            "description": "The hour of the day (0 to 23, UTC) to back up the database every day, such as 2 for 02:00 UTC"
          }
        },
        "required": ["hourUTC"]
      },
      "BackupsCreateInput": {
        "type": "object",
        "properties": {}
      },
      "AuditLogsListInput": {
        "type": "object",
        "properties": {
          "before": {
            "description": "Only events before this time. Pass the previous page's `nextBefore` for the next page",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "limit": {
            "default": 25,
            "description": "How many events to return, newest first. Up to 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "actorUserUuid": {
            "description": "Only events done by this member",
            "type": "string",
            "maxLength": 64
          },
          "recordUuid": {
            "description": "Only events about this record, such as a project's UUID, including changes to its lines and crew",
            "type": "string",
            "maxLength": 64
          },
          "search": {
            "description": "Only events whose description contains this text. Needs `actorUserUuid` or `recordUuid` too",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      },
      "PublicSiteGetInput": {
        "type": "object",
        "properties": {}
      },
      "PublicSiteUpdateInput": {
        "type": "object",
        "properties": {
          "enabled": {
            "description": "Whether the public site is on. While it's off, every public page says it isn't available. Omit to leave unchanged",
            "type": "boolean"
          },
          "introduction": {
            "description": "A few sentences shown at the top of the public site, such as what you hire out and where. Null clears it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "catalogue": {
            "description": "Show a catalogue of the asset types you hire out, for visitors to browse. Omit to leave unchanged",
            "type": "boolean"
          },
          "showPrices": {
            "description": "Show each asset type's hire rate in the catalogue. Omit to leave unchanged",
            "type": "boolean"
          },
          "categoryUUIDs": {
            "description": "UUIDs of the categories the catalogue shows, with their subcategories. Empty for every category. Omit to leave unchanged",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "packages": {
            "description": "Show packages in the catalogue too, with what's in each. Only packages set to show on the public site are listed. Omit to leave unchanged",
            "type": "boolean"
          },
          "enquiries": {
            "description": "Let visitors send an enquiry from the catalogue. Each one becomes a new project. Omit to leave unchanged",
            "type": "boolean"
          },
          "enquiryStatusUUID": {
            "description": "UUID of the status enquiry projects get, or null for the first status at the provisional stage. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "enquiryManagerUUID": {
            "description": "UUID of the member who manages enquiry projects and is emailed about each one, or null for nobody. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "vacancies": {
            "description": "Show the crew vacancies you've chosen to advertise publicly. Omit to leave unchanged",
            "type": "boolean"
          },
          "vacancyClients": {
            "description": "Show the client of each vacancy's project. Omit to leave unchanged",
            "type": "boolean"
          },
          "colourScheme": {
            "description": "`AUTO` follows each visitor's light or dark setting. `LIGHT` or `DARK` always uses that one, such as to match your own website. Omit to leave unchanged",
            "type": "string",
            "enum": ["AUTO", "LIGHT", "DARK"]
          },
          "accentColour": {
            "description": "Colour of buttons and links, as a hex colour such as #1864ab, or null for AdamRMS pink. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "frameHeader": {
            "description": "Show your logo and name at the top when the public site is in a frame on your own website. It's always shown on its own page. Omit to leave unchanged",
            "type": "boolean"
          }
        }
      },
      "SearchQueryInput": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "What to look for. Every word must appear, as the start of a word, in the record's name or text. For example: `source four` finds the asset type ETC Source Four Jr"
          },
          "kinds": {
            "description": "Only these kinds of record. Leave out for every kind the caller may see",
            "maxItems": 7,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "asset-type",
                "asset",
                "project",
                "client",
                "location",
                "wiki-page",
                "member"
              ]
            }
          },
          "limit": {
            "default": 20,
            "description": "How many results to return, best match first (1 to 50)",
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        },
        "required": ["query"]
      },
      "OrganisationDetailsGetInput": {
        "type": "object",
        "properties": {}
      },
      "OrganisationDetailsUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "description": "The organisation's name, shown to members and on documents for clients",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "supportContactInfo": {
            "description": "Who members should contact for help, shown when they lack a permission or a licence. Null for none",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "description": "Postal address, printed on documents for clients such as quotes and invoices. Null for none",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "description": "Phone number for clients. Null for none",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "description": "Email address for clients. Null for none",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "website": {
            "description": "Website address, such as `https://example.com`. Null for none",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "taxIdLabel": {
            "description": "What the organisation's tax registration is called where it trades, such as 'VAT number', 'GST number' or 'ABN'. Printed on documents for clients. Null if not set",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "taxId": {
            "description": "The tax registration number. Null for none",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "companyIdLabel": {
            "description": "What the organisation's company registration is called, such as 'Company number' or 'ACN'. Printed on documents for clients. Null if not set",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "companyId": {
            "description": "The company registration number. Null for none",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "OrganisationDetailsSetEmailHeaderInput": {
        "type": "object",
        "properties": {
          "image": {
            "type": "string",
            "maxLength": 409630,
            "pattern": "^data:image\\/jpeg;base64,([A-Za-z0-9+/]+={0,2})$",
            "description": "The image at the top of emails sent about the organisation: a JPEG of at most 300 KB as a base64 `data:` URL. 1200 by 600 pixels works best"
          }
        },
        "required": ["image"]
      },
      "OrganisationDetailsRemoveEmailHeaderInput": {
        "type": "object",
        "properties": {}
      },
      "OrganisationDetailsSetLogoInput": {
        "type": "object",
        "properties": {
          "image": {
            "type": "string",
            "maxLength": 341366,
            "pattern": "^data:(image\\/(?:png|jpeg|webp));base64,([A-Za-z0-9+/]+={0,2})$",
            "description": "The organisation's logo: a PNG, JPEG or WebP of at most 250 KB as a base64 `data:` URL. A PNG or WebP keeps a transparent background. A wide logo about 4 times as wide as it is tall, up to 512 pixels wide, works best"
          }
        },
        "required": ["image"]
      },
      "OrganisationDetailsRemoveLogoInput": {
        "type": "object",
        "properties": {}
      },
      "AiUsageGetAllowanceInput": {
        "type": "object",
        "properties": {}
      },
      "PriceStructuresListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of price structures per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort price structures by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "PriceStructuresCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, e.g. '3-day week'. Must not match another price structure's name (ignoring case)"
          },
          "description": {
            "description": "What the structure is for",
            "type": "string",
            "maxLength": 1000
          },
          "unit": {
            "type": "string",
            "enum": ["HOUR", "DAY", "WEEK", "MONTH", "NONE"],
            "description": "What one unit of an item's rate pays for: `HOUR`, `DAY`, `WEEK`, `MONTH`, or `NONE` (charged once per project however long it is, also used for sales of consumables)"
          },
          "factors": {
            "minItems": 1,
            "maxItems": 366,
            "type": "array",
            "items": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000
            },
            "description": "Cumulative multipliers of the rate for 1, 2, 3... units: the total charged for that many units, not the extra for each. E.g. `[1, 2, 3, 3, 3, 3, 3]` is a 3-day week: 3 days cost 3x the day rate, and 4 to 7 days cost the same"
          },
          "beyond": {
            "type": "string",
            "enum": ["REPEAT", "EXTEND", "HOLD"],
            "description": "What happens after the last factor: `REPEAT` (start the table again, adding to the total so far - a weekly table charges every week the same), `EXTEND` (add `extendFactor` for each extra unit) or `HOLD` (stay at the last factor)"
          },
          "extendFactor": {
            "description": "With `beyond: EXTEND`, the multiplier of the rate added for each unit after the last factor, e.g. 1 to charge every extra day in full, 0.5 for half price. Defaults to 0",
            "type": "number",
            "minimum": 0,
            "maximum": 1000
          },
          "minimumUnits": {
            "default": 1,
            "description": "A hire shorter than this many units is charged as this many, e.g. 4 for a four-hour minimum. Defaults to 1",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "dayCounting": {
            "default": "CALENDAR",
            "description": "How days are counted from a hire's dates: `CALENDAR` (every calendar day it touches, start and end included) or `ELAPSED` (every started 24 hours, after `leewayMinutes`). Defaults to CALENDAR",
            "type": "string",
            "enum": ["CALENDAR", "ELAPSED"]
          },
          "leewayMinutes": {
            "default": 0,
            "description": "With `ELAPSED` counting (and for hourly structures), how many minutes a hire can overrun before another unit is charged. Defaults to 0",
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "chargeableWeekdays": {
            "description": "The weekdays that are charged with `CALENDAR` counting, e.g. Monday to Friday for a five-day week. Defaults to every day",
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
            }
          },
          "isDefault": {
            "default": false,
            "description": "Make this the organisation's default structure, in place of the current one",
            "type": "boolean"
          }
        },
        "required": ["name", "unit", "factors", "beyond"]
      },
      "PriceStructuresUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the price structure to update"
          },
          "name": {
            "description": "Display name, e.g. '3-day week'. Must not match another price structure's name (ignoring case). Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "unit": {
            "description": "What one unit of an item's rate pays for: `HOUR`, `DAY`, `WEEK`, `MONTH`, or `NONE` (charged once per project however long it is, also used for sales of consumables). Omit to leave unchanged",
            "type": "string",
            "enum": ["HOUR", "DAY", "WEEK", "MONTH", "NONE"]
          },
          "factors": {
            "description": "Cumulative multipliers of the rate for 1, 2, 3... units: the total charged for that many units, not the extra for each. E.g. `[1, 2, 3, 3, 3, 3, 3]` is a 3-day week: 3 days cost 3x the day rate, and 4 to 7 days cost the same. Omit to leave unchanged",
            "minItems": 1,
            "maxItems": 366,
            "type": "array",
            "items": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000
            }
          },
          "beyond": {
            "description": "What happens after the last factor: `REPEAT` (start the table again, adding to the total so far - a weekly table charges every week the same), `EXTEND` (add `extendFactor` for each extra unit) or `HOLD` (stay at the last factor). Omit to leave unchanged",
            "type": "string",
            "enum": ["REPEAT", "EXTEND", "HOLD"]
          },
          "extendFactor": {
            "description": "With `beyond: EXTEND`, the multiplier of the rate added for each unit after the last factor, e.g. 1 to charge every extra day in full, 0.5 for half price. Omit to leave unchanged",
            "type": "number",
            "minimum": 0,
            "maximum": 1000
          },
          "minimumUnits": {
            "description": "A hire shorter than this many units is charged as this many, e.g. 4 for a four-hour minimum. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "dayCounting": {
            "description": "How days are counted from a hire's dates: `CALENDAR` (every calendar day it touches, start and end included) or `ELAPSED` (every started 24 hours, after `leewayMinutes`). Omit to leave unchanged",
            "type": "string",
            "enum": ["CALENDAR", "ELAPSED"]
          },
          "leewayMinutes": {
            "description": "With `ELAPSED` counting (and for hourly structures), how many minutes a hire can overrun before another unit is charged. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "chargeableWeekdays": {
            "description": "The weekdays that are charged with `CALENDAR` counting, e.g. Monday to Friday for a five-day week. Defaults to every day. Omit to leave unchanged",
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
            }
          },
          "isDefault": {
            "description": "true makes this the default structure in place of the current one. The default can't be unset directly: make another structure the default instead",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "PriceStructuresDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the price structure to delete"
          }
        },
        "required": ["uuid"]
      },
      "TaxRatesListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of tax rates per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "position",
            "description": "Field to sort tax rates by. Defaults to `position`",
            "type": "string",
            "enum": ["position", "name"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "TaxRatesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, for example 'Standard'"
          },
          "rateBp": {
            "default": 0,
            "description": "The rate in basis points: 2000 is 20%. Ignored unless `STANDARD`",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "kind": {
            "default": "STANDARD",
            "description": "`STANDARD`, `ZERO`, `EXEMPT` or `REVERSE_CHARGE`",
            "type": "string",
            "enum": ["STANDARD", "ZERO", "EXEMPT", "REVERSE_CHARGE"]
          },
          "code": {
            "description": "Its code in accounting software, such as 'OUTPUT2'",
            "type": "string",
            "maxLength": 50
          },
          "isDefault": {
            "default": false,
            "description": "Make it the rate anything without its own is taxed at",
            "type": "boolean"
          }
        },
        "required": ["name"]
      },
      "TaxRatesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the tax rate to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "rateBp": {
            "description": "New rate in basis points. Lines already on projects keep their rate until their prices are refreshed. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "kind": {
            "description": "New kind. Omit to leave unchanged",
            "type": "string",
            "enum": ["STANDARD", "ZERO", "EXEMPT", "REVERSE_CHARGE"]
          },
          "code": {
            "description": "New code, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "isDefault": {
            "description": "true makes it the default. To change the default, set it on another rate",
            "type": "boolean",
            "const": true
          }
        },
        "required": ["uuid"]
      },
      "TaxRatesReorderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the tax rate to move"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "New position, 0-based. Positions past the end move it to the end"
          }
        },
        "required": ["uuid", "sortOrder"]
      },
      "TaxRatesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the tax rate to delete"
          }
        },
        "required": ["uuid"]
      },
      "TaxRatesAddPresetInput": {
        "type": "object",
        "properties": {
          "preset": {
            "type": "string",
            "enum": ["UK_VAT", "IE_VAT", "AU_GST", "NZ_GST", "CA_GST"],
            "description": "Which set to add: `UK_VAT` (20%, 5%, zero rated, exempt), `IE_VAT`, `AU_GST`, `NZ_GST` or `CA_GST`. Rates with the same name as one you have are skipped"
          }
        },
        "required": ["preset"]
      },
      "TaxSettingsGetInput": {
        "type": "object",
        "properties": {}
      },
      "TaxSettingsUpdateInput": {
        "type": "object",
        "properties": {
          "taxName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30,
            "description": "What tax is called on documents, such as 'VAT' or 'GST'"
          }
        },
        "required": ["taxName"]
      },
      "ServicesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return services whose name contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of services per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort services by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ServicesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Display name, such as 'Delivery' or 'Technician day'"
          },
          "description": {
            "description": "What the service is, shown on quotes",
            "type": "string",
            "maxLength": 5000
          },
          "rate": {
            "description": "Rate of one in the smallest currency unit (such as pence). How a project's length multiplies it is set by the price structure. Omit to price it on each project",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that sets how the length of a project multiplies the rate. Null for the organisation's default. Omit for the default",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at. Null for the organisation's default rate. Omit for the default",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "cost": {
            "description": "What one costs the organisation, in the smallest currency unit, for working out margin. Omit if it has none",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "certificationTypeUUIDs": {
            "default": [],
            "description": "UUIDs of the certification types crew charged as it need, such as IPAF for a rigger. Crew without them are flagged on the project, not refused. Omit for none",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["name"]
      },
      "ServicesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the service to change"
          },
          "name": {
            "description": "Display name, such as 'Delivery' or 'Technician day'. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "rate": {
            "description": "Rate of one in the smallest currency unit (such as pence). How a project's length multiplies it is set by the price structure, or null to price it on each project. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that sets how the length of a project multiplies the rate. Null for the organisation's default. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at. Null for the organisation's default rate. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "cost": {
            "description": "What one costs the organisation, in the smallest currency unit, for working out margin, or null for none. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "certificationTypeUUIDs": {
            "description": "UUIDs of the certification types crew charged as it need, such as IPAF for a rigger. Crew without them are flagged on the project, not refused. Replaces the list. Omit to leave unchanged",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["uuid"]
      },
      "ServicesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the service to delete. Lines already on projects keep their price"
          }
        },
        "required": ["uuid"]
      },
      "CrewRolesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return crew roles whose name contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of crew roles per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort crew roles by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "CrewRolesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The role, such as 'Lighting designer' or 'Sound No.1'"
          },
          "description": {
            "description": "What the role involves, with links to more about it, in Markdown. Shown on every vacancy for it",
            "type": "string",
            "maxLength": 10000
          }
        },
        "required": ["name"]
      },
      "CrewRolesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the crew role to change"
          },
          "name": {
            "description": "The role, such as 'Lighting designer' or 'Sound No.1'. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "What the role involves, with links to more about it, in Markdown. Shown on every vacancy for it, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "CrewRolesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the crew role to delete. Vacancies that used it keep their own description"
          }
        },
        "required": ["uuid"]
      },
      "ProjectTemplatesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return templates whose name contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of templates per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort templates by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ProjectTemplatesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template"
          }
        },
        "required": ["uuid"]
      },
      "ProjectTemplatesCreateInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project to save. Its own lines, crew roles and notes are saved, not its sub-projects'"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The template's name, such as 'Wedding: small PA and lighting'"
          },
          "description": {
            "description": "What the template is for, shown when choosing one",
            "type": "string",
            "maxLength": 5000
          }
        },
        "required": ["projectUUID", "name"]
      },
      "ProjectTemplatesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template to change"
          },
          "name": {
            "description": "The template's name, such as 'Wedding: small PA and lighting'. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ProjectTemplatesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template to delete. Projects already started from it don't change"
          }
        },
        "required": ["uuid"]
      },
      "ProjectLinesListInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          },
          "includeSubProjects": {
            "default": true,
            "description": "Include the lines on its sub-projects. Defaults to true",
            "type": "boolean"
          },
          "groupBy": {
            "default": "NONE",
            "description": "How to group the lines in `groups`: NONE (one group), CATEGORY (by the asset type's category, then packages, then services and charges) or SUB_PROJECT. Each top-level line and everything under it is in one group. Defaults to NONE",
            "type": "string",
            "enum": ["NONE", "CATEGORY", "SUB_PROJECT"]
          },
          "groups": {
            "description": "Only return the lines in these groups, by their `key`. An empty list returns no lines, only the groups and counts. Omit for every group",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 80
            }
          },
          "search": {
            "description": "Only lines whose description, comment or allocated asset IDs contain this text, with the lines above them",
            "type": "string",
            "maxLength": 255
          },
          "filter": {
            "description": "Only lines that are SHORT (need more than is free), TO_ALLOCATE (need more assets allocated) or SUB_HIRE (have stock hired in), with the lines above them",
            "type": "string",
            "enum": ["SHORT", "TO_ALLOCATE", "SUB_HIRE"]
          }
        },
        "required": ["projectUUID"]
      },
      "ProjectLinesAddInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project or sub-project to add to"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ASSET_TYPE",
              "ASSET",
              "PACKAGE",
              "SERVICE",
              "CHARGE",
              "SUB_HIRE"
            ],
            "description": "What to add: ASSET_TYPE (some of an asset type, with its accessories), ASSET (one asset, allocated, with what's in it if it's a case), PACKAGE (a package, with its contents), SERVICE, CHARGE (a one-off line) or SUB_HIRE (something hired in from a supplier)"
          },
          "assetTypeUUID": {
            "description": "The asset type, for ASSET_TYPE",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "assetUUID": {
            "description": "The asset, for ASSET",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "packageUUID": {
            "description": "The package, for PACKAGE",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "serviceUUID": {
            "description": "The service, for SERVICE",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "quantity": {
            "default": 1,
            "description": "How many. For ASSET, 1 for an individual unit or some of a lot. Defaults to 1",
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "description": {
            "description": "What it shows as. Required for CHARGE and SUB_HIRE; otherwise the item's name",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "rate": {
            "description": "Rate of one, in the smallest currency unit. For CHARGE and SUB_HIRE, and to override a service's",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "cost": {
            "description": "What it costs the organisation: of one for CHARGE and SERVICE, of the whole sub-hire for SUB_HIRE",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000
          },
          "comment": {
            "description": "A note on the line",
            "type": "string",
            "maxLength": 2000
          },
          "supplierClientUUID": {
            "description": "For SUB_HIRE: the supplier, a client",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "supplierName": {
            "description": "For SUB_HIRE: the supplier's name, when it isn't a client",
            "type": "string",
            "maxLength": 200
          },
          "reference": {
            "description": "For SUB_HIRE: the supplier's reference",
            "type": "string",
            "maxLength": 200
          },
          "start": {
            "description": "When this line alone goes out. Omit for the project's dates",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "end": {
            "description": "When this line alone comes back. Omit for the project's dates",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": ["projectUUID", "kind"]
      },
      "ProjectLinesAddGroupInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project or sub-project to add to"
          },
          "groupUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset group. Each of its assets is added as if added on its own"
          }
        },
        "required": ["projectUUID", "groupUUID"]
      },
      "ProjectLinesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the line"
          },
          "quantity": {
            "description": "How many. Accessories and package contents under it change in proportion. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "description": {
            "description": "What it shows as. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "comment": {
            "description": "A note on the line, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "charged": {
            "description": "False to send it out free. Omit to leave unchanged",
            "type": "boolean"
          },
          "rate": {
            "description": "Rate of one, or null for none. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "discountBp": {
            "description": "Discount in basis points: 1000 is 10%. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "customPrice": {
            "description": "A price for the whole line that replaces the calculated one, or null to calculate it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "unitsOverride": {
            "description": "Chargeable units for this line, such as 1 for a day of a 3-day project. 0 is free. Null works them out. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxRateUUID": {
            "description": "Tax rate for this line, or null for the rate it would have. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "cost": {
            "description": "What one costs the organisation, or null. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "start": {
            "description": "When this line alone goes out, or null for the project's dates. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "end": {
            "description": "When this line alone comes back, or null for the project's dates. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ProjectLinesRemoveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the line to remove. Lines under it, and their allocations, go too"
          }
        },
        "required": ["uuid"]
      },
      "ProjectLinesReorderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the line"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "New position among the lines next to it, from 0. Positions past the end move it to the end"
          }
        },
        "required": ["uuid", "sortOrder"]
      },
      "ProjectLinesRefreshPricesInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project or sub-project"
          },
          "lineUUID": {
            "description": "Only this line. Omit for every line on the project",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["projectUUID"]
      },
      "ProjectAllocationsAllocateInput": {
        "type": "object",
        "properties": {
          "lineUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the line to fill. It must be of the asset's type"
          },
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          },
          "quantity": {
            "default": 1,
            "description": "How many of a lot. Ignored for individual units. The line grows if it needs to",
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          }
        },
        "required": ["lineUUID", "assetUUID"]
      },
      "ProjectAllocationsAllocateManyInput": {
        "type": "object",
        "properties": {
          "lineUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the line to fill. It must be of the assets' type"
          },
          "assets": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "UUID of the asset"
                },
                "quantity": {
                  "default": 1,
                  "description": "How many of a lot. Ignored for individual units. Defaults to 1",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100000
                }
              },
              "required": ["assetUUID"]
            },
            "description": "The assets to allocate, up to 100"
          }
        },
        "required": ["lineUUID", "assets"]
      },
      "ProjectLinesFreeAssetsInput": {
        "type": "object",
        "properties": {
          "lineUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the line to fill. It must take stock"
          }
        },
        "required": ["lineUUID"]
      },
      "ProjectAllocationsReleaseInput": {
        "type": "object",
        "properties": {
          "allocationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the allocation. Anything allocated because it's in it goes too"
          }
        },
        "required": ["allocationUUID"]
      },
      "ProjectAllocationsSetProgressInput": {
        "type": "object",
        "properties": {
          "allocationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the allocation. Anything packed in it gets the same marks"
          },
          "prepped": {
            "description": "Mark it prepped, or false to take that off (and sent out and back)",
            "type": "boolean"
          },
          "dispatched": {
            "description": "Mark it sent out (and prepped), or false to take that off (and back)",
            "type": "boolean"
          },
          "returned": {
            "description": "Mark it back, less any `missingQuantity`, or false to take that off. It must have gone out",
            "type": "boolean"
          },
          "missingQuantity": {
            "description": "How many didn't come back, such as a cable lost on site. 0 clears it. At most what went out and isn't back",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": ["allocationUUID"]
      },
      "ProjectAllocationsSwapInput": {
        "type": "object",
        "properties": {
          "allocationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the allocation to change"
          },
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset to put in its place, of the same asset type"
          }
        },
        "required": ["allocationUUID", "assetUUID"]
      },
      "SubHiresSetInput": {
        "type": "object",
        "properties": {
          "lineUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the line it fills"
          },
          "uuid": {
            "description": "UUID of the sub-hire to change. Omit to add one",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "supplierClientUUID": {
            "description": "The supplier, a client, or null",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "supplierName": {
            "description": "The supplier's name when it isn't a client, or null",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "reference": {
            "description": "The supplier's reference, such as their order number",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "description": "How many are hired in"
          },
          "cost": {
            "description": "What the whole sub-hire costs, or null if unknown",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "start": {
            "description": "When it arrives, or null",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "end": {
            "description": "When it goes back, or null",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["lineUUID", "quantity"]
      },
      "SubHiresRemoveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the sub-hire to remove"
          }
        },
        "required": ["uuid"]
      },
      "AvailabilityCheckInput": {
        "type": "object",
        "properties": {
          "assetTypeUUIDs": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "The asset types to check, up to 100"
          },
          "start": {
            "description": "Start of the period. With end, or give a project",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "end": {
            "description": "End of the period",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "projectUUID": {
            "description": "Check for this project: its out period, unless start and end are given, and leaving out its own lines",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["assetTypeUUIDs"]
      },
      "ClientPricingListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of client pricing per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort client pricing by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ClientPricingGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client pricing"
          }
        },
        "required": ["uuid"]
      },
      "ClientPricingCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, e.g. 'Trade' or 'Dry hire'. Must not match another client pricing's name (ignoring case)"
          },
          "description": {
            "description": "What the list is for",
            "type": "string",
            "maxLength": 1000
          },
          "adjustmentPercent": {
            "description": "Percentage added to the catalogue rate of anything the list has no entry for: -15 is 15% off, 10 is 10% more. Null charges catalogue prices for those",
            "type": "number",
            "minimum": -100,
            "maximum": 1000
          },
          "validFrom": {
            "description": "First date (YYYY-MM-DD) the list may be used on, for seasonal lists. Checked against the start of a project's charge period",
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "validTo": {
            "description": "Last date (YYYY-MM-DD) the list may be used on",
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          }
        },
        "required": ["name"]
      },
      "ClientPricingUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client pricing to update"
          },
          "name": {
            "description": "Display name, e.g. 'Trade' or 'Dry hire'. Must not match another client pricing's name (ignoring case). Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "adjustmentPercent": {
            "description": "Percentage added to the catalogue rate of anything the list has no entry for: -15 is 15% off, 10 is 10% more. Null charges catalogue prices for those. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "number",
                "minimum": -100,
                "maximum": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "validFrom": {
            "description": "First date (YYYY-MM-DD) the list may be used on, for seasonal lists. Checked against the start of a project's charge period, or null for no first date. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "validTo": {
            "description": "Last date (YYYY-MM-DD) the list may be used on, or null for no last date. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ClientPricingDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client pricing to delete"
          }
        },
        "required": ["uuid"]
      },
      "ClientPricingSetEntryInput": {
        "type": "object",
        "properties": {
          "clientPricingUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client pricing"
          },
          "assetTypeUUID": {
            "description": "UUID of the asset type to price. Give this or `categoryUUID`",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "categoryUUID": {
            "description": "UUID of the category to price, with its subcategories. An asset type's own entry wins over its category's",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "rate": {
            "description": "A fixed rate in the smallest currency unit, replacing the catalogue's (including an asset's own rate). Asset type entries only",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "adjustmentPercent": {
            "description": "Percentage added to the catalogue rate: -20 is 20% off. Not with `rate`",
            "anyOf": [
              {
                "type": "number",
                "minimum": -100,
                "maximum": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "priceStructureUUID": {
            "description": "UUID of a price structure to charge with instead of the catalogue's, e.g. a 3-day week for dry hire",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["clientPricingUUID"]
      },
      "ClientPricingRemoveEntryInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the entry to remove"
          }
        },
        "required": ["uuid"]
      },
      "ClientsSetPricingInput": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client"
          },
          "clientPricingUUID": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "UUID of the client pricing its projects use, or null for none"
          }
        },
        "required": ["clientUUID", "clientPricingUUID"]
      },
      "PricesPreviewInput": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "description": "UUID of the asset type to price. Give this or `assetUUID`",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "assetUUID": {
            "description": "UUID of one asset to price, using its own rate if it has one",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "clientPricingUUID": {
            "description": "UUID of client pricing to price through. Omit for catalogue prices",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "units": {
            "default": [1],
            "description": "Hire lengths to price, in the structure's units (days for a daily structure). Defaults to [1]",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            }
          }
        }
      },
      "CustomFieldsListInput": {
        "type": "object",
        "properties": {
          "recordType": {
            "default": "asset",
            "description": "Which record type's fields to list",
            "type": "string",
            "enum": ["asset"]
          }
        }
      },
      "CustomFieldsCreateInput": {
        "type": "object",
        "properties": {
          "recordType": {
            "default": "asset",
            "description": "The kind of record the field is added to",
            "type": "string",
            "enum": ["asset"]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Label shown on the form, e.g. 'Serial number' or 'Wattage'"
          },
          "description": {
            "description": "Help text shown under the field",
            "type": "string",
            "maxLength": 1000
          },
          "type": {
            "type": "string",
            "enum": [
              "TEXT",
              "RICH_TEXT",
              "NUMBER",
              "BOOLEAN",
              "DATE",
              "SELECT",
              "URL",
              "FILE",
              "IMAGE"
            ],
            "description": "What kind of value it holds: TEXT (one line), RICH_TEXT (formatted text), NUMBER, BOOLEAN (yes/no), DATE, SELECT (one of `options`), URL, FILE (one of the record's attached files) or IMAGE (a picture, stored small - use FILE for full-size images). Can't be changed later"
          },
          "showOnLabels": {
            "default": false,
            "description": "Print the value on asset labels. Defaults to false",
            "type": "boolean"
          },
          "showOnDocuments": {
            "default": false,
            "description": "Print the asset type's value under its lines on quotes and invoices, such as a lantern's power. Only fields set on the type (TYPE or BOTH) have a type value to print. Defaults to false",
            "type": "boolean"
          },
          "showInLists": {
            "default": false,
            "description": "Show the asset's value beside its asset ID in the list of assets and on its page, such as a friendly name. Only TEXT, NUMBER and SELECT values are shown. Defaults to false",
            "type": "boolean"
          },
          "setOn": {
            "default": "BOTH",
            "description": "Where the value is set: TYPE (on the asset type, shared by its assets), RECORD (on each asset) or BOTH (on the asset type, and optionally on an asset to override it). Defaults to BOTH",
            "type": "string",
            "enum": ["TYPE", "RECORD", "BOTH"]
          },
          "requirement": {
            "default": "OPTIONAL",
            "description": "OPTIONAL (the default), REQUIRED everywhere, or REQUIRED_FOR_CATEGORIES (required for records in `requiredCategoryUUIDs` or their subcategories). A TYPE field must be filled in on the asset type, a RECORD field on the asset, and a BOTH field on the asset unless its asset type provides the value",
            "type": "string",
            "enum": ["OPTIONAL", "REQUIRED", "REQUIRED_FOR_CATEGORIES"]
          },
          "requiredCategoryUUIDs": {
            "description": "Asset categories the field is required for. Needed when the requirement is REQUIRED_FOR_CATEGORIES, ignored otherwise",
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "appliesTo": {
            "default": "ALL",
            "description": "ALL (the default): on every asset type and its assets. TYPES: only on the asset types in `assetTypeUUIDs` and their assets",
            "type": "string",
            "enum": ["ALL", "TYPES"]
          },
          "assetTypeUUIDs": {
            "description": "Asset types the field is used by, when `appliesTo` is TYPES. Ignored otherwise. May be empty, to add the field to a type later",
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "maxLength": {
            "description": "TEXT and RICH_TEXT only: the most characters a value may have. Defaults to 255 for TEXT (at most 1000) and 10000 for RICH_TEXT",
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "decimalPlaces": {
            "description": "NUMBER only: how many decimal places a value may have. 0 (the default) allows whole numbers only",
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "minimum": {
            "description": "NUMBER only: the smallest value allowed. Omit for no minimum",
            "type": "number"
          },
          "maximum": {
            "description": "NUMBER only: the largest value allowed. Omit for no maximum",
            "type": "number"
          },
          "unit": {
            "description": "NUMBER only: unit shown after the value, e.g. 'kg' or 'W'",
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "options": {
            "description": "SELECT only: the choices, in display order. Required for SELECT fields, and each must be unique",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        },
        "required": ["name", "type"]
      },
      "CustomFieldsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the field to update"
          },
          "name": {
            "description": "New label. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "description": "New help text, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "showOnLabels": {
            "description": "Whether to print the value on asset labels. Omit to leave unchanged",
            "type": "boolean"
          },
          "showOnDocuments": {
            "description": "Whether to print the asset type's value under its lines on quotes and invoices. Omit to leave unchanged",
            "type": "boolean"
          },
          "showInLists": {
            "description": "Whether to show the asset's value beside its asset ID in the list of assets and on its page. Omit to leave unchanged",
            "type": "boolean"
          },
          "setOn": {
            "description": "New setting for where the value is set: TYPE, RECORD or BOTH. Values already stored at a level the field no longer allows are kept but ignored. Omit to leave unchanged",
            "type": "string",
            "enum": ["TYPE", "RECORD", "BOTH"]
          },
          "requirement": {
            "description": "New requirement. Omit to leave unchanged",
            "type": "string",
            "enum": ["OPTIONAL", "REQUIRED", "REQUIRED_FOR_CATEGORIES"]
          },
          "requiredCategoryUUIDs": {
            "description": "New list of asset categories the field is required for, replacing the old one. Omit to leave unchanged",
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "appliesTo": {
            "description": "ALL: on every asset type. TYPES: only on the types in `assetTypeUUIDs`. Omit to leave unchanged",
            "type": "string",
            "enum": ["ALL", "TYPES"]
          },
          "assetTypeUUIDs": {
            "description": "New list of asset types the field is used by, replacing the old one. Omit to leave unchanged",
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "maxLength": {
            "description": "TEXT and RICH_TEXT only: new maximum characters. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "decimalPlaces": {
            "description": "NUMBER only: new decimal places. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "minimum": {
            "description": "NUMBER only: new minimum, or null to remove it. Omit to leave unchanged",
            "type": ["number", "null"]
          },
          "maximum": {
            "description": "NUMBER only: new maximum, or null to remove it. Omit to leave unchanged",
            "type": ["number", "null"]
          },
          "unit": {
            "description": "NUMBER only: new unit, or null to remove it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "options": {
            "description": "SELECT only: new choices, replacing the old ones. Omit to leave unchanged",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        },
        "required": ["uuid"]
      },
      "CustomFieldsReorderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the field to move"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "New position on the form, 0-based. Positions past the end move it to the end"
          }
        },
        "required": ["uuid", "sortOrder"]
      },
      "CustomFieldsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the field to delete"
          }
        },
        "required": ["uuid"]
      },
      "CommentsListInput": {
        "type": "object",
        "properties": {
          "recordType": {
            "type": "string",
            "enum": [
              "asset-category",
              "asset",
              "asset-type",
              "client",
              "client-contact",
              "location",
              "maintenance-job",
              "project",
              "manufacturer"
            ],
            "description": "The kind of record: `asset-category` (an asset category), `asset` (an asset (one unit, or one bulk lot)), `asset-type` (an asset type (a catalogue entry)), `client` (a client), `client-contact` (a person at a client), `location` (a location), `maintenance-job` (a maintenance job (a fault or piece of work on assets)), `project` (a project (an event, show or hire)), `manufacturer` (a manufacturer of assets)"
          },
          "recordUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the record"
          },
          "includeArchived": {
            "default": false,
            "description": "Also return archived comments",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of comments per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort comments by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["recordType", "recordUuid"]
      },
      "CommentsListMineInput": {
        "type": "object",
        "properties": {
          "filter": {
            "type": "string",
            "enum": ["assigned", "created", "mentioned"],
            "description": "Which of the caller's comments: `assigned` to them as a task, `created` by them, or `mentioned` them"
          },
          "status": {
            "default": "open",
            "description": "Only open comments, only resolved ones, or both",
            "type": "string",
            "enum": ["open", "resolved", "all"]
          },
          "includeArchived": {
            "default": false,
            "description": "Also return archived comments",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of comments per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort comments by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt", "updatedAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["filter"]
      },
      "CommentsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the comment"
          }
        },
        "required": ["uuid"]
      },
      "CommentsPeopleInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return people whose name contains this text",
            "type": "string",
            "maxLength": 255
          }
        }
      },
      "CommentsCreateInput": {
        "type": "object",
        "properties": {
          "recordType": {
            "type": "string",
            "enum": [
              "asset-category",
              "asset",
              "asset-type",
              "client",
              "client-contact",
              "location",
              "maintenance-job",
              "project",
              "manufacturer"
            ],
            "description": "The kind of record: `asset-category` (an asset category), `asset` (an asset (one unit, or one bulk lot)), `asset-type` (an asset type (a catalogue entry)), `client` (a client), `client-contact` (a person at a client), `location` (a location), `maintenance-job` (a maintenance job (a fault or piece of work on assets)), `project` (a project (an event, show or hire)), `manufacturer` (a manufacturer of assets)"
          },
          "recordUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the record to comment on"
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000,
            "description": "The comment, in Markdown. Mention someone with `[@Name](mention:<user uuid>)` to email them a link to it"
          },
          "assigneeUUID": {
            "description": "UUID of a member to assign the comment to as a task. They are emailed a link to it",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "attachmentUUIDs": {
            "description": "UUIDs of files, already uploaded to the organisation's file storage, to attach",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["recordType", "recordUuid", "body"]
      },
      "CommentsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the comment to change"
          },
          "body": {
            "description": "New text, in Markdown. Only the author can change it. People newly mentioned are emailed. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "assigneeUUID": {
            "description": "UUID of the member to assign the comment to, or null to unassign. A new assignee is emailed. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "attachmentUUIDs": {
            "description": "The complete new list of attached file UUIDs. Only the author can change it. Omit to leave unchanged",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["uuid"]
      },
      "CommentsResolveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the comment"
          },
          "resolved": {
            "default": true,
            "description": "True to mark it resolved, false to reopen it",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "CommentsArchiveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the comment"
          },
          "archived": {
            "default": true,
            "description": "True to archive it, false to restore it",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "IconsListInput": {
        "type": "object",
        "properties": {}
      },
      "IconsCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, e.g. 'Pyrotechnics'"
          },
          "contentType": {
            "type": "string",
            "enum": ["image/svg+xml", "image/png", "image/webp"],
            "description": "Image format of `content`"
          },
          "content": {
            "type": "string",
            "maxLength": 87384,
            "format": "base64",
            "contentEncoding": "base64",
            "pattern": "^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$",
            "description": "The image, base64-encoded. At most 64 KB. A square image works best; it is drawn at small sizes"
          }
        },
        "required": ["name", "contentType", "content"]
      },
      "IconsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the icon to delete"
          }
        },
        "required": ["uuid"]
      },
      "InvitationsListInput": {
        "type": "object",
        "properties": {}
      },
      "InvitationsCreateInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
            "description": "Email address to send the invitation to"
          },
          "roleUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the role the invitee will be given when they join"
          }
        },
        "required": ["email", "roleUUID"]
      },
      "InvitationsResendInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the invitation"
          }
        },
        "required": ["uuid"]
      },
      "InvitationsRevokeInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the invitation"
          }
        },
        "required": ["uuid"]
      },
      "MembersListInput": {
        "type": "object",
        "properties": {
          "includeRemoved": {
            "default": false,
            "description": "Also return members who have been removed. Needs permission to view removed members",
            "type": "boolean"
          }
        }
      },
      "MembersChangeRoleInput": {
        "type": "object",
        "properties": {
          "userUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The member's user UUID"
          },
          "roleUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the role to give the member"
          }
        },
        "required": ["userUuid", "roleUUID"]
      },
      "MembersRemoveInput": {
        "type": "object",
        "properties": {
          "userUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The member's user UUID"
          },
          "at": {
            "description": "Remove them at this time instead of now, such as the end of their contract. They keep their licence and access until then. Must be in the future",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": ["userUuid"]
      },
      "MembersRestoreInput": {
        "type": "object",
        "properties": {
          "userUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The member's user UUID"
          },
          "roleUUID": {
            "description": "UUID of the role to give the member. Defaults to the role they had when they were removed",
            "type": "string",
            "maxLength": 64
          }
        },
        "required": ["userUuid"]
      },
      "MembersCancelRemovalInput": {
        "type": "object",
        "properties": {
          "userUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The member's user UUID"
          }
        },
        "required": ["userUuid"]
      },
      "MembersGetInput": {
        "type": "object",
        "properties": {
          "userUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The member's user UUID"
          }
        },
        "required": ["userUuid"]
      },
      "MembersMeInput": {
        "type": "object",
        "properties": {}
      },
      "MembersUpdateInput": {
        "type": "object",
        "properties": {
          "userUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The member's user UUID"
          },
          "jobTitle": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "description": "What they do in the organisation, such as \"Lighting technician\", or null to clear it"
          }
        },
        "required": ["userUuid", "jobTitle"]
      },
      "LicencesListInput": {
        "type": "object",
        "properties": {}
      },
      "LicencesAssignInput": {
        "type": "object",
        "properties": {
          "userUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "User UUID of the member to give a licence to. They must be a current member without one"
          }
        },
        "required": ["userUuid"]
      },
      "LicencesUnassignInput": {
        "type": "object",
        "properties": {
          "licenceUuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the licence to take back from its member"
          }
        },
        "required": ["licenceUuid"]
      },
      "FilesListInput": {
        "type": "object",
        "properties": {
          "category": {
            "description": "Only files in this category. Omit for every category",
            "type": "string",
            "enum": [
              "INVOICES",
              "DOCUMENTS",
              "ASSET_THUMBNAILS",
              "RECEIPTS",
              "PROJECT_FILES",
              "ATTACHMENTS",
              "COMMENT_ATTACHMENTS",
              "SCAN_MEDIA",
              "CERTIFICATION_EVIDENCE",
              "CREW_APPLICATIONS",
              "AI_IMPORTS",
              "GENERATED_DOCUMENTS",
              "ISSUED_DOCUMENTS",
              "DATABASE_BACKUPS"
            ]
          },
          "search": {
            "description": "Only files whose name contains this text, ignoring case",
            "type": "string",
            "maxLength": 200
          },
          "trash": {
            "default": false,
            "description": "List the files in the trash instead of the live ones. Needs permission to delete files",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of files per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort files by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt", "name", "sizeBytes"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "FilesRenameInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the file or link"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "The new display name"
          }
        },
        "required": ["uuid", "name"]
      },
      "FilesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the file or link"
          }
        },
        "required": ["uuid"]
      },
      "FilesRestoreInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the file or link"
          }
        },
        "required": ["uuid"]
      },
      "FilesAddLinkInput": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "INVOICES",
              "DOCUMENTS",
              "ASSET_THUMBNAILS",
              "RECEIPTS",
              "PROJECT_FILES",
              "ATTACHMENTS",
              "COMMENT_ATTACHMENTS",
              "SCAN_MEDIA",
              "CERTIFICATION_EVIDENCE",
              "CREW_APPLICATIONS",
              "AI_IMPORTS",
              "GENERATED_DOCUMENTS",
              "ISSUED_DOCUMENTS",
              "DATABASE_BACKUPS"
            ],
            "description": "The category to add the link to. Only some categories take links, such as `DOCUMENTS` and `PROJECT_FILES`"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "What to call the link, such as \"Venue tech spec\""
          },
          "url": {
            "type": "string",
            "maxLength": 2000,
            "format": "uri",
            "description": "The address the link opens, such as https://example.com/spec"
          },
          "tags": {
            "description": "Key:value tags to file it under, one value per key",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "Tag name"
                },
                "value": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Tag value"
                }
              },
              "required": ["key", "value"]
            }
          }
        },
        "required": ["category", "name", "url"]
      },
      "FilesStartUploadInput": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "INVOICES",
              "DOCUMENTS",
              "ASSET_THUMBNAILS",
              "RECEIPTS",
              "PROJECT_FILES",
              "ATTACHMENTS",
              "COMMENT_ATTACHMENTS",
              "SCAN_MEDIA",
              "CERTIFICATION_EVIDENCE",
              "CREW_APPLICATIONS",
              "AI_IMPORTS",
              "GENERATED_DOCUMENTS",
              "ISSUED_DOCUMENTS",
              "DATABASE_BACKUPS"
            ],
            "description": "The category to upload to. Only some categories take uploads, such as `DOCUMENTS` and `PROJECT_FILES`"
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Name of the file, with its extension, such as 'rigging-plan.pdf'"
          },
          "contentType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Content type of the file, such as `application/pdf`"
          },
          "sizeBytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "Exact size of the file in bytes"
          },
          "tags": {
            "description": "Key:value tags to file it under, one value per key",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "Tag name"
                },
                "value": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Tag value"
                }
              },
              "required": ["key", "value"]
            }
          }
        },
        "required": ["category", "fileName", "contentType", "sizeBytes"]
      },
      "FilesFinishUploadInput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The `uploadToken` from `files.start-upload`"
          },
          "parts": {
            "description": "For a multipart upload, every part that was sent. Omit for a single upload",
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "partNumber": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000,
                  "description": "Part number, 1-based"
                },
                "etag": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "description": "The `ETag` the part's PUT returned"
                }
              },
              "required": ["partNumber", "etag"]
            }
          }
        },
        "required": ["uploadToken"]
      },
      "RolesListInput": {
        "type": "object",
        "properties": {}
      },
      "RolesReorderInput": {
        "type": "object",
        "properties": {
          "uuids": {
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "UUID of the role"
            },
            "description": "UUIDs of the custom roles in the order to list them. Any left out keep their order, after these"
          }
        },
        "required": ["uuids"]
      },
      "RolesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name"
          },
          "description": {
            "description": "Optional description",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "permissions": {
            "default": [],
            "description": "Everything members with this role can do",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "AUDIT_LOGS.VIEW",
                "AI_USAGE.VIEW",
                "ORGANISATIONS_USERS.VIEW",
                "ORGANISATIONS_USERS.CREATE",
                "ORGANISATIONS_USERS.UPDATE",
                "ORGANISATIONS_USERS.DELETE",
                "ORGANISATIONS_USERS.VIEW_DELETED",
                "ORGANISATIONS_USERS.RESTORE",
                "ORGANISATIONS_USERS.SEND",
                "ORGANISATIONS_PERMISSIONS.VIEW",
                "ORGANISATIONS_PERMISSIONS.CREATE",
                "ORGANISATIONS_PERMISSIONS.UPDATE",
                "ORGANISATIONS_PERMISSIONS.DELETE",
                "ORGANISATIONS_PERMISSIONS.VIEW_DELETED",
                "ORGANISATIONS_PERMISSIONS.RESTORE",
                "ORGANISATIONS_LICENCES.VIEW",
                "ORGANISATIONS_LICENCES.UPDATE",
                "ORGANISATIONS_JOIN_METHODS.VIEW",
                "ORGANISATIONS_JOIN_METHODS.CREATE",
                "ORGANISATIONS_JOIN_METHODS.UPDATE",
                "ORGANISATIONS_JOIN_METHODS.DELETE",
                "WEBHOOKS.VIEW",
                "WEBHOOKS.CREATE",
                "WEBHOOKS.UPDATE",
                "WEBHOOKS.DELETE",
                "ORGANISATIONS_SUBSCRIPTION.VIEW",
                "ORGANISATIONS_SUBSCRIPTION.UPDATE",
                "ORGANISATION_FILES.VIEW",
                "ORGANISATION_FILES.CREATE",
                "ORGANISATION_FILES.UPDATE",
                "ORGANISATION_FILES.DELETE",
                "ORGANISATIONS_SETTINGS.VIEW",
                "ORGANISATIONS_SETTINGS.UPDATE",
                "ASSET_CATEGORIES.VIEW",
                "ASSET_CATEGORIES.COMMENT",
                "ASSET_CATEGORIES.CREATE",
                "ASSET_CATEGORIES.UPDATE",
                "ASSET_CATEGORIES.DELETE",
                "ASSET_CATEGORIES.VIEW_DELETED",
                "ASSET_CATEGORIES.RESTORE",
                "CLIENTS.VIEW",
                "CLIENTS.COMMENT",
                "CLIENTS.CREATE",
                "CLIENTS.UPDATE",
                "CLIENTS.DELETE",
                "CLIENTS.VIEW_DELETED",
                "LOCATIONS.VIEW",
                "LOCATIONS.COMMENT",
                "LOCATIONS.CREATE",
                "LOCATIONS.UPDATE",
                "LOCATIONS.DELETE",
                "LOCATIONS.VIEW_DELETED",
                "MANUFACTURERS.VIEW",
                "MANUFACTURERS.COMMENT",
                "MANUFACTURERS.CREATE",
                "MANUFACTURERS.UPDATE",
                "MANUFACTURERS.DELETE",
                "MANUFACTURERS.VIEW_DELETED",
                "ASSET_TYPES.VIEW",
                "ASSET_TYPES.COMMENT",
                "ASSET_TYPES.CREATE",
                "ASSET_TYPES.UPDATE",
                "ASSET_TYPES.DELETE",
                "ASSET_TYPES.VIEW_DELETED",
                "ASSETS.VIEW",
                "ASSETS.COMMENT",
                "ASSETS.CREATE",
                "ASSETS.UPDATE",
                "ASSETS.ARCHIVE",
                "ASSETS.MANAGE_IDS",
                "ASSETS.EDIT_PRICING",
                "ASSETS.ADJUST_STOCK",
                "ASSETS.SCAN",
                "ASSETS.IMPORT",
                "ASSETS.DELETE",
                "ASSETS.VIEW_DELETED",
                "ASSETS.RESTORE",
                "MAINTENANCE_JOBS.VIEW",
                "MAINTENANCE_JOBS.COMMENT",
                "MAINTENANCE_JOBS.CREATE",
                "MAINTENANCE_JOBS.UPDATE",
                "MAINTENANCE_JOBS.FLAG_AND_BLOCK",
                "MAINTENANCE_JOBS.DELETE",
                "PROJECTS.VIEW",
                "PROJECTS.COMMENT",
                "PROJECTS.CREATE",
                "PROJECTS.UPDATE",
                "PROJECTS.DELETE",
                "PROJECTS.VIEW_DELETED",
                "PROJECTS.RESTORE",
                "PROJECT_TEMPLATES.VIEW",
                "PROJECT_TEMPLATES.CREATE",
                "PROJECT_TEMPLATES.UPDATE",
                "PROJECT_TEMPLATES.DELETE",
                "CALENDAR.VIEW",
                "DASHBOARD.VIEW",
                "PROJECT_ASSETS.VIEW",
                "PROJECT_ASSETS.UPDATE",
                "PROJECT_ASSETS.PRICES",
                "QUOTES.VIEW",
                "QUOTES.ISSUE",
                "QUOTES.UPDATE",
                "INVOICES.VIEW",
                "INVOICES.CREATE",
                "INVOICES.ISSUE",
                "INVOICES.CREDIT",
                "PAYMENTS.VIEW",
                "PAYMENTS.RECORD",
                "PAYMENTS.DELETE",
                "PROJECT_CREW.VIEW",
                "PROJECT_CREW.UPDATE",
                "PROJECT_CREW.EMAIL",
                "PROJECT_CREW.RECRUIT",
                "PROJECT_CREW.APPLY",
                "INSPECTIONS.VIEW",
                "INSPECTIONS.RECORD",
                "INSPECTIONS.DELETE",
                "DOCUMENT_TEMPLATES.VIEW",
                "DOCUMENT_TEMPLATES.CREATE",
                "DOCUMENT_TEMPLATES.UPDATE",
                "DOCUMENT_TEMPLATES.DELETE",
                "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
                "ASSET_GROUPS.VIEW",
                "ASSET_GROUPS.CREATE",
                "ASSET_GROUPS.UPDATE",
                "ASSET_GROUPS.DELETE",
                "WIKI_PAGES.VIEW",
                "WIKI_PAGES.CREATE",
                "WIKI_PAGES.UPDATE",
                "WIKI_PAGES.DELETE",
                "WIKI_PAGES.VIEW_STATS",
                "WIKI_PAGES.SET_DASHBOARDS",
                "TRAINING_MODULES.VIEW",
                "TRAINING_MODULES.CREATE",
                "TRAINING_MODULES.UPDATE",
                "TRAINING_MODULES.DELETE",
                "TRAINING_MODULES.VIEW_PROGRESS",
                "CERTIFICATION_TYPES.VIEW",
                "CERTIFICATION_TYPES.CREATE",
                "CERTIFICATION_TYPES.UPDATE",
                "CERTIFICATION_TYPES.DELETE",
                "MEMBER_CERTIFICATIONS.VIEW",
                "MEMBER_CERTIFICATIONS.CREATE",
                "MEMBER_CERTIFICATIONS.UPDATE",
                "MEMBER_CERTIFICATIONS.REVOKE",
                "LABEL_TEMPLATES.VIEW",
                "LABEL_TEMPLATES.CREATE",
                "LABEL_TEMPLATES.UPDATE",
                "LABEL_TEMPLATES.DELETE",
                "PACKAGES.VIEW",
                "PACKAGES.CREATE",
                "PACKAGES.UPDATE",
                "PACKAGES.DELETE",
                "PRICE_STRUCTURES.VIEW",
                "PRICE_STRUCTURES.CREATE",
                "PRICE_STRUCTURES.UPDATE",
                "PRICE_STRUCTURES.DELETE",
                "CLIENT_PRICING.VIEW",
                "CLIENT_PRICING.CREATE",
                "CLIENT_PRICING.UPDATE",
                "CLIENT_PRICING.DELETE",
                "CUSTOM_FIELDS.VIEW",
                "CUSTOM_FIELDS.CREATE",
                "CUSTOM_FIELDS.UPDATE",
                "CUSTOM_FIELDS.DELETE",
                "COMMENTS.VIEW",
                "COMMENTS.UPDATE",
                "SEARCH.VIEW",
                "APPS.VIEW",
                "APPS.CREATE",
                "APPS.UPDATE",
                "APPS.DELETE",
                "APPS.INSTALL",
                "APPS.RUN",
                "APPS.PUBLISH"
              ],
              "description": "A permission, `<AREA>.<ACTION>`, e.g. `ASSET_CATEGORIES.VIEW`"
            }
          },
          "position": {
            "description": "Where the role is listed among custom roles, lowest first. New roles go last, and an update leaves it as it is, if omitted",
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          }
        },
        "required": ["name"]
      },
      "RolesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the role"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name"
          },
          "description": {
            "description": "Optional description",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "permissions": {
            "default": [],
            "description": "Everything members with this role can do",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "AUDIT_LOGS.VIEW",
                "AI_USAGE.VIEW",
                "ORGANISATIONS_USERS.VIEW",
                "ORGANISATIONS_USERS.CREATE",
                "ORGANISATIONS_USERS.UPDATE",
                "ORGANISATIONS_USERS.DELETE",
                "ORGANISATIONS_USERS.VIEW_DELETED",
                "ORGANISATIONS_USERS.RESTORE",
                "ORGANISATIONS_USERS.SEND",
                "ORGANISATIONS_PERMISSIONS.VIEW",
                "ORGANISATIONS_PERMISSIONS.CREATE",
                "ORGANISATIONS_PERMISSIONS.UPDATE",
                "ORGANISATIONS_PERMISSIONS.DELETE",
                "ORGANISATIONS_PERMISSIONS.VIEW_DELETED",
                "ORGANISATIONS_PERMISSIONS.RESTORE",
                "ORGANISATIONS_LICENCES.VIEW",
                "ORGANISATIONS_LICENCES.UPDATE",
                "ORGANISATIONS_JOIN_METHODS.VIEW",
                "ORGANISATIONS_JOIN_METHODS.CREATE",
                "ORGANISATIONS_JOIN_METHODS.UPDATE",
                "ORGANISATIONS_JOIN_METHODS.DELETE",
                "WEBHOOKS.VIEW",
                "WEBHOOKS.CREATE",
                "WEBHOOKS.UPDATE",
                "WEBHOOKS.DELETE",
                "ORGANISATIONS_SUBSCRIPTION.VIEW",
                "ORGANISATIONS_SUBSCRIPTION.UPDATE",
                "ORGANISATION_FILES.VIEW",
                "ORGANISATION_FILES.CREATE",
                "ORGANISATION_FILES.UPDATE",
                "ORGANISATION_FILES.DELETE",
                "ORGANISATIONS_SETTINGS.VIEW",
                "ORGANISATIONS_SETTINGS.UPDATE",
                "ASSET_CATEGORIES.VIEW",
                "ASSET_CATEGORIES.COMMENT",
                "ASSET_CATEGORIES.CREATE",
                "ASSET_CATEGORIES.UPDATE",
                "ASSET_CATEGORIES.DELETE",
                "ASSET_CATEGORIES.VIEW_DELETED",
                "ASSET_CATEGORIES.RESTORE",
                "CLIENTS.VIEW",
                "CLIENTS.COMMENT",
                "CLIENTS.CREATE",
                "CLIENTS.UPDATE",
                "CLIENTS.DELETE",
                "CLIENTS.VIEW_DELETED",
                "LOCATIONS.VIEW",
                "LOCATIONS.COMMENT",
                "LOCATIONS.CREATE",
                "LOCATIONS.UPDATE",
                "LOCATIONS.DELETE",
                "LOCATIONS.VIEW_DELETED",
                "MANUFACTURERS.VIEW",
                "MANUFACTURERS.COMMENT",
                "MANUFACTURERS.CREATE",
                "MANUFACTURERS.UPDATE",
                "MANUFACTURERS.DELETE",
                "MANUFACTURERS.VIEW_DELETED",
                "ASSET_TYPES.VIEW",
                "ASSET_TYPES.COMMENT",
                "ASSET_TYPES.CREATE",
                "ASSET_TYPES.UPDATE",
                "ASSET_TYPES.DELETE",
                "ASSET_TYPES.VIEW_DELETED",
                "ASSETS.VIEW",
                "ASSETS.COMMENT",
                "ASSETS.CREATE",
                "ASSETS.UPDATE",
                "ASSETS.ARCHIVE",
                "ASSETS.MANAGE_IDS",
                "ASSETS.EDIT_PRICING",
                "ASSETS.ADJUST_STOCK",
                "ASSETS.SCAN",
                "ASSETS.IMPORT",
                "ASSETS.DELETE",
                "ASSETS.VIEW_DELETED",
                "ASSETS.RESTORE",
                "MAINTENANCE_JOBS.VIEW",
                "MAINTENANCE_JOBS.COMMENT",
                "MAINTENANCE_JOBS.CREATE",
                "MAINTENANCE_JOBS.UPDATE",
                "MAINTENANCE_JOBS.FLAG_AND_BLOCK",
                "MAINTENANCE_JOBS.DELETE",
                "PROJECTS.VIEW",
                "PROJECTS.COMMENT",
                "PROJECTS.CREATE",
                "PROJECTS.UPDATE",
                "PROJECTS.DELETE",
                "PROJECTS.VIEW_DELETED",
                "PROJECTS.RESTORE",
                "PROJECT_TEMPLATES.VIEW",
                "PROJECT_TEMPLATES.CREATE",
                "PROJECT_TEMPLATES.UPDATE",
                "PROJECT_TEMPLATES.DELETE",
                "CALENDAR.VIEW",
                "DASHBOARD.VIEW",
                "PROJECT_ASSETS.VIEW",
                "PROJECT_ASSETS.UPDATE",
                "PROJECT_ASSETS.PRICES",
                "QUOTES.VIEW",
                "QUOTES.ISSUE",
                "QUOTES.UPDATE",
                "INVOICES.VIEW",
                "INVOICES.CREATE",
                "INVOICES.ISSUE",
                "INVOICES.CREDIT",
                "PAYMENTS.VIEW",
                "PAYMENTS.RECORD",
                "PAYMENTS.DELETE",
                "PROJECT_CREW.VIEW",
                "PROJECT_CREW.UPDATE",
                "PROJECT_CREW.EMAIL",
                "PROJECT_CREW.RECRUIT",
                "PROJECT_CREW.APPLY",
                "INSPECTIONS.VIEW",
                "INSPECTIONS.RECORD",
                "INSPECTIONS.DELETE",
                "DOCUMENT_TEMPLATES.VIEW",
                "DOCUMENT_TEMPLATES.CREATE",
                "DOCUMENT_TEMPLATES.UPDATE",
                "DOCUMENT_TEMPLATES.DELETE",
                "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
                "ASSET_GROUPS.VIEW",
                "ASSET_GROUPS.CREATE",
                "ASSET_GROUPS.UPDATE",
                "ASSET_GROUPS.DELETE",
                "WIKI_PAGES.VIEW",
                "WIKI_PAGES.CREATE",
                "WIKI_PAGES.UPDATE",
                "WIKI_PAGES.DELETE",
                "WIKI_PAGES.VIEW_STATS",
                "WIKI_PAGES.SET_DASHBOARDS",
                "TRAINING_MODULES.VIEW",
                "TRAINING_MODULES.CREATE",
                "TRAINING_MODULES.UPDATE",
                "TRAINING_MODULES.DELETE",
                "TRAINING_MODULES.VIEW_PROGRESS",
                "CERTIFICATION_TYPES.VIEW",
                "CERTIFICATION_TYPES.CREATE",
                "CERTIFICATION_TYPES.UPDATE",
                "CERTIFICATION_TYPES.DELETE",
                "MEMBER_CERTIFICATIONS.VIEW",
                "MEMBER_CERTIFICATIONS.CREATE",
                "MEMBER_CERTIFICATIONS.UPDATE",
                "MEMBER_CERTIFICATIONS.REVOKE",
                "LABEL_TEMPLATES.VIEW",
                "LABEL_TEMPLATES.CREATE",
                "LABEL_TEMPLATES.UPDATE",
                "LABEL_TEMPLATES.DELETE",
                "PACKAGES.VIEW",
                "PACKAGES.CREATE",
                "PACKAGES.UPDATE",
                "PACKAGES.DELETE",
                "PRICE_STRUCTURES.VIEW",
                "PRICE_STRUCTURES.CREATE",
                "PRICE_STRUCTURES.UPDATE",
                "PRICE_STRUCTURES.DELETE",
                "CLIENT_PRICING.VIEW",
                "CLIENT_PRICING.CREATE",
                "CLIENT_PRICING.UPDATE",
                "CLIENT_PRICING.DELETE",
                "CUSTOM_FIELDS.VIEW",
                "CUSTOM_FIELDS.CREATE",
                "CUSTOM_FIELDS.UPDATE",
                "CUSTOM_FIELDS.DELETE",
                "COMMENTS.VIEW",
                "COMMENTS.UPDATE",
                "SEARCH.VIEW",
                "APPS.VIEW",
                "APPS.CREATE",
                "APPS.UPDATE",
                "APPS.DELETE",
                "APPS.INSTALL",
                "APPS.RUN",
                "APPS.PUBLISH"
              ],
              "description": "A permission, `<AREA>.<ACTION>`, e.g. `ASSET_CATEGORIES.VIEW`"
            }
          },
          "position": {
            "description": "Where the role is listed among custom roles, lowest first. New roles go last, and an update leaves it as it is, if omitted",
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          }
        },
        "required": ["uuid", "name"]
      },
      "RolesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the role"
          }
        },
        "required": ["uuid"]
      },
      "WebhooksListInput": {
        "type": "object",
        "properties": {}
      },
      "WebhooksCreateInput": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000,
            "format": "uri",
            "description": "The HTTPS address to send events to, such as https://example.com/adamrms"
          },
          "events": {
            "minItems": 1,
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Event types to send: function keys such as `clients.create`, or a whole feature such as `clients.*`. Only functions that change data are events"
          },
          "description": {
            "description": "What the webhook is for, such as the system it feeds",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["url", "events"]
      },
      "WebhooksUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "description": "The webhook's UUID"
          },
          "url": {
            "description": "A new address to send events to",
            "type": "string",
            "maxLength": 2000,
            "format": "uri"
          },
          "events": {
            "description": "The event types to send from now on, replacing the list",
            "minItems": 1,
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "description": {
            "description": "What the webhook is for, such as the system it feeds",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "description": "false to stop sending events, true to start again",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "WebhooksDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "description": "The webhook's UUID"
          }
        },
        "required": ["uuid"]
      },
      "WebhooksDeliveriesInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "description": "The webhook's UUID"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of deliveries per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort deliveries by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["uuid"]
      },
      "JoinCodesListInput": {
        "type": "object",
        "properties": {}
      },
      "JoinCodesCreateInput": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 8,
            "maxLength": 64,
            "description": "The code people will enter, or use in a link. At least 8 characters, case-insensitive, and unique across AdamRMS"
          },
          "roleUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the role people who join with it are given. Cannot be the Administrator role"
          },
          "jobTitle": {
            "description": "Job title given to everyone who joins with the code, such as \"Freelance technician\"",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "description": "Notes for administrators, such as where the code was shared. Never shown to people joining",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["code", "roleUUID"]
      },
      "JoinCodesUpdateInput": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The join code. Case-insensitive"
          },
          "active": {
            "description": "Whether the code can be used to join. Left as it is if omitted",
            "type": "boolean"
          },
          "roleUUID": {
            "description": "UUID of the role people who join with it are given. Cannot be the Administrator role. Left as it is if omitted",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "jobTitle": {
            "description": "Job title given to everyone who joins with the code, such as \"Freelance technician\"",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "description": "Notes for administrators, such as where the code was shared. Never shown to people joining",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["code"]
      },
      "JoinCodesDeleteInput": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The join code. Case-insensitive"
          }
        },
        "required": ["code"]
      },
      "EmailDomainsListInput": {
        "type": "object",
        "properties": {}
      },
      "EmailDomainsCreateInput": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "pattern": "^[a-z0-9][a-z0-9.-]*\\.[a-z]{2,}$",
            "description": "The email domain, e.g. `example.com`"
          },
          "roleUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the role people who join this way are given. Cannot be the Administrator role"
          }
        },
        "required": ["domain", "roleUUID"]
      },
      "EmailDomainsUpdateInput": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "description": "The email domain, e.g. `example.com`"
          },
          "active": {
            "type": "boolean",
            "description": "Whether people with this domain can join"
          }
        },
        "required": ["domain", "active"]
      },
      "EmailDomainsDeleteInput": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "description": "The email domain, e.g. `example.com`"
          }
        },
        "required": ["domain"]
      },
      "SingleSignOnGetInput": {
        "type": "object",
        "properties": {}
      },
      "SingleSignOnUpdateInput": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Turns single sign-on on or off. Turning it on needs the identity provider's details, a role for new members and a verified domain"
          },
          "required": {
            "type": "boolean",
            "description": "Whether members at a verified domain must sign in through the identity provider. Administrators are exempt"
          },
          "idpEntityId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ],
            "description": "The identity provider's entity ID (its issuer)"
          },
          "idpSignOnUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048,
                "format": "uri"
              },
              {
                "type": "null"
              }
            ],
            "description": "The identity provider's single sign-on URL, for the HTTP-Redirect binding"
          },
          "idpCertificates": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 16384
            },
            "description": "Certificates the identity provider signs with, PEM or base64. Give two while it rotates its certificate"
          },
          "newMemberRoleUUID": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "UUID of the role people get when they first sign in through single sign-on. Can't be the Administrator role"
          }
        },
        "required": [
          "enabled",
          "required",
          "idpEntityId",
          "idpSignOnUrl",
          "idpCertificates",
          "newMemberRoleUUID"
        ]
      },
      "SingleSignOnDomainsAddInput": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*\\.[a-z]{2,}$",
            "description": "The email domain, such as `example.com`"
          }
        },
        "required": ["domain"]
      },
      "SingleSignOnDomainsVerifyInput": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*\\.[a-z]{2,}$",
            "description": "The email domain, such as `example.com`"
          }
        },
        "required": ["domain"]
      },
      "SingleSignOnDomainsRemoveInput": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*\\.[a-z]{2,}$",
            "description": "The email domain, such as `example.com`"
          }
        },
        "required": ["domain"]
      },
      "OrganisationUrlListInput": {
        "type": "object",
        "properties": {}
      },
      "OrganisationUrlChangeInput": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The new URL slug. It is made URL-safe (lower case, letters, digits and dashes), and reserved words such as `support` or `admin` are removed; the result must be at least 8 characters. If another organisation already uses it, a suffix is added"
          }
        },
        "required": ["slug"]
      },
      "AppsListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return Apps whose name or key contains this text",
            "type": "string",
            "maxLength": 255
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of Apps per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort Apps by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "AppsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the App"
          }
        },
        "required": ["uuid"]
      },
      "AppsCreateInput": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{1,49}$",
            "description": "Stable identifier, e.g. `xero-sync`. Must not match another of the organisation's Apps"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, e.g. 'Xero sync'"
          },
          "description": {
            "description": "What the App does, shown to administrators",
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": ["key", "name"]
      },
      "AppsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the App to update"
          },
          "name": {
            "description": "New display name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "AppsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the App to delete. It must be uninstalled first"
          }
        },
        "required": ["uuid"]
      },
      "AppsVersionsCreateInput": {
        "type": "object",
        "properties": {
          "appUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the App"
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "pattern": "^[0-9A-Za-z][0-9A-Za-z.+-]*$",
            "description": "Label for the version, e.g. `1.2.0`. Must not match another version of the same App"
          },
          "manifest": {
            "$ref": "#/components/schemas/AppManifest"
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200000,
            "description": "One ES module, no imports. Each exported function is a handler, called as `handler(event, ctx)`: `event` is the run's input (for an after hook, `{ id, type: \"after\", function, input, output, actor, occurredAt }`, where `output` has the hooked function's documented output type; for a before hook, see the manifest's `hooks`), `ctx.settings` the installation's settings, and `ctx.storage` a small key-value store (`get`, `put`, `delete`, `list`). Call organisation functions as `adamrms.<name>(input)`, e.g. `await adamrms.clients_list({})`, and the web with `fetch`. What a handler returns is recorded as the run's result, and for a before hook decides the call"
          }
        },
        "required": ["appUUID", "version", "manifest", "code"]
      },
      "AppsVersionsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the version"
          }
        },
        "required": ["uuid"]
      },
      "AppsInstallInput": {
        "type": "object",
        "properties": {
          "appUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the App to install"
          },
          "versionUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the version to install"
          },
          "settings": {
            "default": {},
            "description": "Values for the settings the version's manifest declares, by name. Every required setting must be given",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 64
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          }
        },
        "required": ["appUUID", "versionUUID"]
      },
      "AppsUpgradeInput": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation"
          },
          "versionUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the version to move to. Its manifest replaces what was approved before"
          },
          "settings": {
            "description": "New setting values. Omit to keep the current ones, which must still satisfy the new version's settings",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 64
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          }
        },
        "required": ["installationUUID", "versionUUID"]
      },
      "AppsUninstallInput": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation to remove"
          }
        },
        "required": ["installationUUID"]
      },
      "AppsUpdateSettingsInput": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation"
          },
          "settings": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 64
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            },
            "description": "Values for the settings the version's manifest declares, by name. Every required setting must be given"
          }
        },
        "required": ["installationUUID", "settings"]
      },
      "AppsSetSecretInput": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation"
          },
          "name": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
            "description": "Name of the secret, as the version's manifest declares it"
          },
          "value": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 8000
              },
              {
                "type": "null"
              }
            ],
            "description": "The secret's value, or null to remove it. Never returned"
          }
        },
        "required": ["installationUUID", "name", "value"]
      },
      "AppsRunInput": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation to run"
          },
          "handler": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Name of the exported function to run"
          },
          "input": {
            "description": "The event passed to the handler: any JSON value"
          }
        },
        "required": ["installationUUID", "handler"]
      },
      "AppsResumeInput": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the paused installation"
          }
        },
        "required": ["installationUUID"]
      },
      "AppsSetHookOrderInput": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation"
          },
          "hookOrder": {
            "type": "integer",
            "minimum": -1000,
            "maximum": 1000,
            "description": "Where its before hooks run among other Apps' on the same function: lower first, then the earliest installed. Defaults to 0"
          }
        },
        "required": ["installationUUID", "hookOrder"]
      },
      "AppsRunsListInput": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "description": "Only return runs of this installation",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of runs per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort runs by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "AppsRunsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the run"
          }
        },
        "required": ["uuid"]
      },
      "AppsPublishInput": {
        "type": "object",
        "properties": {
          "appUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the App to publish"
          },
          "versionUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the version to submit. AdamRMS reviews it by hand before listing it"
          }
        },
        "required": ["appUUID", "versionUUID"]
      },
      "AppsMarketplaceListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return Apps whose name or key contains this text",
            "type": "string",
            "maxLength": 255
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of listings per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort listings by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "AppsMarketplaceGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the listing"
          }
        },
        "required": ["uuid"]
      },
      "AppsMarketplaceAddInput": {
        "type": "object",
        "properties": {
          "listingUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the listing to add"
          }
        },
        "required": ["listingUUID"]
      },
      "AppsUiAssetPanelRenderInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset whose page shows the panels"
          },
          "installationUUID": {
            "description": "Only the panel of this installation, as listed by `apps.ui.asset-panel.list`. Omit for every App's",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["assetUUID"]
      },
      "AppsUiAssetPanelListInput": {
        "type": "object",
        "properties": {}
      },
      "AppsUiAssetPanelActionInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset whose page shows the panels"
          },
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation whose panel it is"
          },
          "action": {
            "description": "The handler to run, one of the panel's actions. Give this or `function`",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "function": {
            "description": "The name of one of the App's own functions to call instead, as the caller, with the button's `input` or the form's values as its input. Give this or `action`",
            "type": "string",
            "minLength": 1,
            "maxLength": 50
          },
          "input": {
            "description": "The button's `input`, given to the handler as `event.input`"
          },
          "values": {
            "description": "A form's values, by field name, given as `event.values`",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 64
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 10000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "required": ["assetUUID", "installationUUID"]
      },
      "AppsUiClientPanelRenderInput": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client whose page shows the panels"
          },
          "installationUUID": {
            "description": "Only the panel of this installation, as listed by `its installation`. Omit for every App's",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["clientUUID"]
      },
      "AppsUiClientPanelActionInput": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client whose page shows the panels"
          },
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation whose panel it is"
          },
          "action": {
            "description": "The handler to run, one of the panel's actions. Give this or `function`",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "function": {
            "description": "The name of one of the App's own functions to call instead, as the caller, with the button's `input` or the form's values as its input. Give this or `action`",
            "type": "string",
            "minLength": 1,
            "maxLength": 50
          },
          "input": {
            "description": "The button's `input`, given to the handler as `event.input`"
          },
          "values": {
            "description": "A form's values, by field name, given as `event.values`",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 64
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 10000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "required": ["clientUUID", "installationUUID"]
      },
      "AppsUiProjectFinancePanelRenderInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project whose page shows the panels"
          },
          "installationUUID": {
            "description": "Only the panel of this installation, as listed by `its installation`. Omit for every App's",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["projectUUID"]
      },
      "AppsUiProjectFinancePanelActionInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project whose page shows the panels"
          },
          "installationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the installation whose panel it is"
          },
          "action": {
            "description": "The handler to run, one of the panel's actions. Give this or `function`",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "function": {
            "description": "The name of one of the App's own functions to call instead, as the caller, with the button's `input` or the form's values as its input. Give this or `action`",
            "type": "string",
            "minLength": 1,
            "maxLength": 50
          },
          "input": {
            "description": "The button's `input`, given to the handler as `event.input`"
          },
          "values": {
            "description": "A form's values, by field name, given as `event.values`",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 64
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 10000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "required": ["projectUUID", "installationUUID"]
      },
      "LegacyImportStatusInput": {
        "type": "object",
        "properties": {
          "preflight": {
            "default": true,
            "description": "Count the records waiting in the previous version. Reads its database, so it is slower",
            "type": "boolean"
          }
        }
      },
      "LegacyImportRunsListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of runs per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "startedAt",
            "description": "Field to sort runs by. Defaults to `startedAt`",
            "type": "string",
            "enum": ["startedAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "LegacyImportRunsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the run"
          }
        },
        "required": ["uuid"]
      },
      "LegacyImportStartInput": {
        "type": "object",
        "properties": {}
      },
      "LegacyImportCancelInput": {
        "type": "object",
        "properties": {}
      },
      "LegacyImportDisconnectInput": {
        "type": "object",
        "properties": {}
      },
      "LegacyImportFinishInput": {
        "type": "object",
        "properties": {}
      },
      "LocationBarcodesListInput": {
        "type": "object",
        "properties": {
          "locationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the location"
          }
        },
        "required": ["locationUUID"]
      },
      "LocationBarcodesAddInput": {
        "type": "object",
        "properties": {
          "locationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the location"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The barcode as printed. Must not already be a live location barcode or asset ID"
          },
          "symbology": {
            "description": "What it is printed as. Omit if not known",
            "type": "string",
            "enum": [
              "QR_CODE",
              "CODE_128",
              "CODE_39",
              "CODE_93",
              "EAN_8",
              "EAN_13"
            ]
          },
          "notes": {
            "description": "Notes, for example 'Old shelf label'",
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": ["locationUUID", "value"]
      },
      "LocationBarcodesRemoveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the barcode record to remove"
          }
        },
        "required": ["uuid"]
      },
      "BarcodesResolveInput": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "A barcode as scanned or typed"
          }
        },
        "required": ["value"]
      },
      "ScanSessionsStartInput": {
        "type": "object",
        "properties": {
          "targetKind": {
            "type": "string",
            "enum": ["LOCATION", "CASE", "STOCK_CHECK", "NONE", "PROJECT"],
            "description": "`LOCATION`, `CASE`, `STOCK_CHECK` (a location), `NONE` or `PROJECT`"
          },
          "locationUUID": {
            "description": "UUID of the location, for LOCATION and STOCK_CHECK",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "caseUUID": {
            "description": "UUID of the case asset, for CASE",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "projectUUID": {
            "description": "UUID of the project, for PROJECT. Its sub-projects' assets are scanned with it",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "projectStage": {
            "description": "For PROJECT: `PREP` marks each asset prepped (allocating it to a line of its type that needs one), `DISPATCH` marks it sent out, `RETURN` marks it back",
            "type": "string",
            "enum": ["PREP", "DISPATCH", "RETURN"]
          },
          "targetBarcode": {
            "description": "The barcode that was scanned to choose the target. When it belongs to the target, the session's target is verified",
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "mode": {
            "default": "RECORD",
            "description": "`RECORD` (default) only records sightings. `MOVE` also moves each asset to the target, which needs permission to edit assets",
            "type": "string",
            "enum": ["RECORD", "MOVE"]
          },
          "includeSubLocations": {
            "default": false,
            "description": "Stock checks only: also expect assets stored in locations inside the target",
            "type": "boolean"
          },
          "filming": {
            "description": "Film scans. Omit to use the organisation's default. Ignored when the organisation makes filming compulsory",
            "type": "boolean"
          },
          "photosRequired": {
            "description": "Require a condition photo with every scan. Omit to use the organisation's default. Ignored when the organisation makes photos compulsory",
            "type": "boolean"
          },
          "inspectionTemplateUUID": {
            "description": "UUID of an inspection template: each asset scanned is then inspected with it, such as PAT testing a batch",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["targetKind"]
      },
      "ScanSessionsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the session"
          }
        },
        "required": ["uuid"]
      },
      "ScanSessionsVerifyTargetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the session"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The barcode scanned at the target"
          }
        },
        "required": ["uuid", "value"]
      },
      "ScanSessionsEndInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the session"
          }
        },
        "required": ["uuid"]
      },
      "ScanSessionsListInput": {
        "type": "object",
        "properties": {
          "locationUUID": {
            "description": "Only sessions into this location",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "targetKind": {
            "description": "Only sessions of this kind, for example STOCK_CHECK",
            "type": "string",
            "enum": ["LOCATION", "CASE", "STOCK_CHECK", "NONE", "PROJECT"]
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of sessions per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "startedAt",
            "description": "Field to sort sessions by. Defaults to `startedAt`",
            "type": "string",
            "enum": ["startedAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ScansRecordInput": {
        "type": "object",
        "properties": {
          "sessionUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the open session to record it in"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The barcode as scanned or typed"
          },
          "method": {
            "type": "string",
            "enum": ["CAMERA", "SCANNER", "TYPED"],
            "description": "`CAMERA`, `SCANNER` (handheld or Bluetooth) or `TYPED`"
          },
          "quantity": {
            "description": "For a lot: how many of it were seen. Omit for the whole lot. Ignored for a unit",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "latitude": {
            "description": "Device latitude, if it gave one",
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "description": "Device longitude, if it gave one",
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "accuracyMetres": {
            "description": "How accurate the position is, in metres",
            "type": "number",
            "minimum": 0,
            "maximum": 1000000
          },
          "scannedAt": {
            "description": "When it was scanned, if it was queued on the device. Omit for now. Can't be in the future or more than a day ago",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": ["sessionUUID", "value", "method"]
      },
      "ScansUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the scan"
          },
          "quantity": {
            "description": "For a lot: how many of it were seen, at most the lot's size. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "condition": {
            "description": "`GOOD`, `WORN` or `DAMAGED`. Omit to leave unchanged",
            "type": "string",
            "enum": ["GOOD", "WORN", "DAMAGED"]
          },
          "conditionNote": {
            "description": "A note on its condition, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ScansListInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "description": "Only scans of this asset",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "locationUUID": {
            "description": "Only scans at this location",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "sessionUUID": {
            "description": "Only scans in this session",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "condition": {
            "description": "Only scans rated this condition",
            "type": "string",
            "enum": ["GOOD", "WORN", "DAMAGED"]
          },
          "withPhotos": {
            "default": false,
            "description": "Only scans with a condition photo",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of scans per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "scannedAt",
            "description": "Field to sort scans by. Defaults to `scannedAt`",
            "type": "string",
            "enum": ["scannedAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ScansLatestInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          }
        },
        "required": ["assetUUID"]
      },
      "ScanMediaStartUploadInput": {
        "type": "object",
        "properties": {
          "scanUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the scan"
          },
          "kind": {
            "type": "string",
            "enum": ["PHOTO", "VIDEO"],
            "description": "`PHOTO` (a condition photo) or `VIDEO` (footage of the scan)"
          },
          "contentType": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/webp",
              "image/png",
              "video/mp4",
              "video/webm"
            ],
            "description": "The file's type: JPEG, WebP or PNG for photos, MP4 or WebM for footage"
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "Size in bytes. Photos can be at most 15 MB, footage 50 MB"
          }
        },
        "required": ["scanUUID", "kind", "contentType", "sizeBytes"]
      },
      "ScanMediaFinishUploadInput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The token `scan-media.start-upload` returned"
          }
        },
        "required": ["uploadToken"]
      },
      "ScanPhotosRemoveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the photo to remove"
          }
        },
        "required": ["uuid"]
      },
      "StockChecksResultInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the session"
          }
        },
        "required": ["uuid"]
      },
      "ScanPresetsListInput": {
        "type": "object",
        "properties": {}
      },
      "ScanPresetsCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, for example 'Returns'"
          },
          "targetKind": {
            "type": "string",
            "enum": ["LOCATION", "CASE", "STOCK_CHECK", "NONE", "PROJECT"],
            "description": "What it scans into. Not `PROJECT`"
          },
          "locationUUID": {
            "description": "UUID of the location, for LOCATION and STOCK_CHECK",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "caseUUID": {
            "description": "UUID of the case asset, for CASE",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "mode": {
            "type": "string",
            "enum": ["RECORD", "MOVE"],
            "description": "`RECORD` or `MOVE`"
          },
          "includeSubLocations": {
            "type": "boolean",
            "description": "Stock checks only: include locations inside the target"
          },
          "filming": {
            "type": "boolean",
            "description": "Film scans"
          },
          "photosRequired": {
            "type": "boolean",
            "description": "Require a condition photo"
          },
          "inspectionTemplateUUID": {
            "description": "UUID of an inspection template to inspect each asset with, or null for none",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "targetKind",
          "mode",
          "includeSubLocations",
          "filming",
          "photosRequired"
        ]
      },
      "ScanPresetsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the preset"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, for example 'Returns'"
          },
          "targetKind": {
            "type": "string",
            "enum": ["LOCATION", "CASE", "STOCK_CHECK", "NONE", "PROJECT"],
            "description": "What it scans into. Not `PROJECT`"
          },
          "locationUUID": {
            "description": "UUID of the location, for LOCATION and STOCK_CHECK",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "caseUUID": {
            "description": "UUID of the case asset, for CASE",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "mode": {
            "type": "string",
            "enum": ["RECORD", "MOVE"],
            "description": "`RECORD` or `MOVE`"
          },
          "includeSubLocations": {
            "type": "boolean",
            "description": "Stock checks only: include locations inside the target"
          },
          "filming": {
            "type": "boolean",
            "description": "Film scans"
          },
          "photosRequired": {
            "type": "boolean",
            "description": "Require a condition photo"
          },
          "inspectionTemplateUUID": {
            "description": "UUID of an inspection template to inspect each asset with, or null for none",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "uuid",
          "name",
          "targetKind",
          "mode",
          "includeSubLocations",
          "filming",
          "photosRequired"
        ]
      },
      "ScanPresetsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the preset to delete"
          }
        },
        "required": ["uuid"]
      },
      "ScanSettingsGetInput": {
        "type": "object",
        "properties": {}
      },
      "ScanSettingsUpdateInput": {
        "type": "object",
        "properties": {
          "filming": {
            "description": "`OFF`, `DEFAULT_ON` or `REQUIRED`. Omit to leave unchanged",
            "type": "string",
            "enum": ["OFF", "DEFAULT_ON", "REQUIRED"]
          },
          "photos": {
            "description": "`OFF`, `DEFAULT_ON` or `REQUIRED`. Omit to leave unchanged",
            "type": "string",
            "enum": ["OFF", "DEFAULT_ON", "REQUIRED"]
          },
          "footageRetentionDays": {
            "description": "Days to keep footage: 30, 90, 365, 730, 1825 or 3650, or 0 for forever. Applies to footage recorded from now on. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "number",
                "const": 30
              },
              {
                "type": "number",
                "const": 90
              },
              {
                "type": "number",
                "const": 365
              },
              {
                "type": "number",
                "const": 730
              },
              {
                "type": "number",
                "const": 1825
              },
              {
                "type": "number",
                "const": 3650
              },
              {
                "type": "number",
                "const": 0
              }
            ]
          }
        }
      },
      "MaintenanceStatusesListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of statuses per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "position",
            "description": "Field to sort statuses by. Defaults to `position`",
            "type": "string",
            "enum": ["position", "name"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "MaintenanceStatusesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, for example 'Waiting for parts'"
          },
          "isOpen": {
            "default": true,
            "description": "Whether jobs in this status are still open. Defaults to true. Use false for statuses such as 'Closed'",
            "type": "boolean"
          }
        },
        "required": ["name"]
      },
      "MaintenanceStatusesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "isOpen": {
            "description": "Whether jobs in this status are open. Omit to leave unchanged. The last open status can't be closed",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "MaintenanceStatusesReorderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status or priority to move"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "New position, 0-based. Positions past the end move it to the end"
          }
        },
        "required": ["uuid", "sortOrder"]
      },
      "MaintenanceStatusesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status or priority to delete"
          },
          "replacementUUID": {
            "description": "Jobs that use the one being deleted move to this one. Needed when any job uses it",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["uuid"]
      },
      "MaintenancePrioritiesListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of priorities per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "position",
            "description": "Field to sort priorities by. Defaults to `position`",
            "type": "string",
            "enum": ["position", "name"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "MaintenancePrioritiesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, for example 'Urgent'"
          },
          "colour": {
            "default": "gray",
            "description": "Colour of its badge. Defaults to gray",
            "type": "string",
            "enum": ["red", "yellow", "green", "blue", "gray"]
          },
          "isDefault": {
            "default": false,
            "description": "Make it the priority new jobs get",
            "type": "boolean"
          }
        },
        "required": ["name"]
      },
      "MaintenancePrioritiesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the priority to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "colour": {
            "description": "New badge colour. Omit to leave unchanged",
            "type": "string",
            "enum": ["red", "yellow", "green", "blue", "gray"]
          },
          "isDefault": {
            "description": "true makes it the priority new jobs get. To change the default, set it on another priority",
            "type": "boolean",
            "const": true
          }
        },
        "required": ["uuid"]
      },
      "MaintenancePrioritiesReorderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status or priority to move"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "New position, 0-based. Positions past the end move it to the end"
          }
        },
        "required": ["uuid", "sortOrder"]
      },
      "MaintenancePrioritiesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status or priority to delete"
          },
          "replacementUUID": {
            "description": "Jobs that use the one being deleted move to this one. Needed when any job uses it",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["uuid"]
      },
      "MaintenanceJobsListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only jobs whose title contains this text, or whose number is this",
            "type": "string",
            "maxLength": 255
          },
          "state": {
            "default": "OPEN",
            "description": "`OPEN` (the default) for jobs in an open status, `CLOSED` for the rest, or `ALL`",
            "type": "string",
            "enum": ["OPEN", "CLOSED", "ALL"]
          },
          "statusUUID": {
            "description": "Only jobs in this status",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "priorityUUID": {
            "description": "Only jobs with this priority",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "assigneeUUID": {
            "description": "Only jobs assigned to this member",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "assetUUID": {
            "description": "Only jobs that cover this asset",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of jobs per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "number",
            "description": "Field to sort jobs by. Defaults to `number`",
            "type": "string",
            "enum": [
              "number",
              "title",
              "priority",
              "dueAt",
              "createdAt",
              "updatedAt"
            ]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "MaintenanceJobsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "description": "UUID of the job. Give this or `number`",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "number": {
            "description": "The job's number. Give this or `uuid`",
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          }
        }
      },
      "MaintenanceJobsCreateInput": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Short summary, for example 'Fan noisy'"
          },
          "description": {
            "description": "What's wrong, in more detail",
            "type": "string",
            "maxLength": 10000
          },
          "assets": {
            "default": [],
            "description": "The assets the job covers, at most 100",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "UUID of the asset"
                },
                "quantity": {
                  "default": 1,
                  "description": "How many of it the job covers. 1 (the default) for a unit; for a bulk lot, at most the lot's quantity",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000000
                }
              },
              "required": ["assetUUID"]
            }
          },
          "statusUUID": {
            "description": "UUID of its status. Omit for the first open status",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "priorityUUID": {
            "description": "UUID of its priority. Omit for the default priority",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "assigneeUUID": {
            "description": "UUID of the member to assign it to",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "dueAt": {
            "description": "When it should be done by",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "flagAssets": {
            "default": false,
            "description": "Show a warning on its assets while it's open",
            "type": "boolean"
          },
          "blockAssets": {
            "default": false,
            "description": "Stop its assets being booked onto projects while it's open",
            "type": "boolean"
          },
          "watcherUUIDs": {
            "default": [],
            "description": "UUIDs of members to watch the job. They are emailed about it",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "number": {
            "description": "The job number to use, for a job brought across from another system. Ignored if another job has it. Omit for the next number",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000000
          },
          "createdByUUID": {
            "description": "Only for the import from the previous version of AdamRMS: who created the job there. Ignored otherwise, when the job is created by you",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["title"]
      },
      "MaintenanceJobsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job to change"
          },
          "title": {
            "description": "New title. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "statusUUID": {
            "description": "UUID of its new status. Moving to a closed status closes the job. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "priorityUUID": {
            "description": "UUID of its new priority. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "assigneeUUID": {
            "description": "UUID of the member to assign it to, or null to unassign. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "dueAt": {
            "description": "New due date, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "flagAssets": {
            "description": "Show a warning on its assets while it's open. Omit to leave unchanged",
            "type": "boolean"
          },
          "blockAssets": {
            "description": "Stop its assets being booked while it's open. Omit to leave unchanged",
            "type": "boolean"
          },
          "cost": {
            "description": "What the work cost, in the smallest unit of the organisation's currency, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "supplier": {
            "description": "Who did the work, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "outcome": {
            "description": "How it ended: `REPAIRED`, `NO_FAULT_FOUND` or `BEYOND_REPAIR`, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "enum": ["REPAIRED", "NO_FAULT_FOUND", "BEYOND_REPAIR"]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "MaintenanceJobsSetAssetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job"
          },
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset to add, or to change"
          },
          "quantity": {
            "default": 1,
            "description": "How many of it the job covers. 1 (the default) for a unit; for a bulk lot, at most the lot's quantity",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "released": {
            "default": false,
            "description": "true lifts the job's flag and block from this asset while the job stays open, such as once it's fixed",
            "type": "boolean"
          }
        },
        "required": ["uuid", "assetUUID"]
      },
      "MaintenanceJobsRemoveAssetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job"
          },
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset to take off the job"
          }
        },
        "required": ["uuid", "assetUUID"]
      },
      "MaintenanceJobsWatchInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job"
          },
          "userUUID": {
            "description": "UUID of the member. Omit for yourself",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "watching": {
            "type": "boolean",
            "description": "true to start watching the job, false to stop"
          }
        },
        "required": ["uuid", "watching"]
      },
      "MaintenanceJobsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job to delete"
          }
        },
        "required": ["uuid"]
      },
      "MaintenanceJobsSetCostsInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job"
          },
          "costs": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": ["PART", "LABOUR", "OTHER"],
                  "description": "`PART`, `LABOUR` (quantity is hours) or `OTHER`"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "description": "What it was, such as 'Replacement fan' or 'Bench time'"
                },
                "quantity": {
                  "default": 1,
                  "description": "How many, or hours of labour",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                },
                "unitCost": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000000000,
                  "description": "Each, in the smallest unit of the organisation's currency (pence for GBP)"
                }
              },
              "required": ["kind", "description", "unitCost"]
            },
            "description": "Every item, in order, at most 50. Replaces the list. An empty list keeps the job's cost as it is"
          }
        },
        "required": ["uuid", "costs"]
      },
      "MaintenanceJobsChargeToProjectInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job"
          },
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project to charge, such as the hire the asset was damaged on"
          },
          "amount": {
            "description": "What to charge the client, in the smallest currency unit. Omit to charge what the job cost",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000
          },
          "description": {
            "description": "How the charge reads on the quote and invoice. Omit for 'Repair: ' and the job's title",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": ["uuid", "projectUUID"]
      },
      "MaintenanceJobsRemoveChargeInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job"
          }
        },
        "required": ["uuid"]
      },
      "MaintenanceJobsChargeableProjectsInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the job"
          }
        },
        "required": ["uuid"]
      },
      "MaintenanceAssetStateInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          }
        },
        "required": ["assetUUID"]
      },
      "ProjectStatusesListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of statuses per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "position",
            "description": "Field to sort statuses by. Defaults to `position`",
            "type": "string",
            "enum": ["position", "name"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ProjectStatusesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, for example 'Quote sent'"
          },
          "description": {
            "description": "What the status means, for the people picking it",
            "type": "string",
            "maxLength": 500
          },
          "stage": {
            "type": "string",
            "enum": ["ENQUIRY", "PROVISIONAL", "CONFIRMED", "FINISHED", "LOST"],
            "description": "What the status does: `ENQUIRY`, `PROVISIONAL`, `CONFIRMED`, `FINISHED` or `LOST`"
          },
          "isDefault": {
            "default": false,
            "description": "Make it the status new projects get",
            "type": "boolean"
          }
        },
        "required": ["name", "stage"]
      },
      "ProjectStatusesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "stage": {
            "description": "New stage. Projects already in the status move with it. Omit to leave unchanged",
            "type": "string",
            "enum": ["ENQUIRY", "PROVISIONAL", "CONFIRMED", "FINISHED", "LOST"]
          },
          "isDefault": {
            "description": "true makes it the status new projects get. To change the default, set it on another status",
            "type": "boolean",
            "const": true
          }
        },
        "required": ["uuid"]
      },
      "ProjectStatusesReorderInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status to move"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "New position, 0-based. Positions past the end move it to the end"
          }
        },
        "required": ["uuid", "sortOrder"]
      },
      "ProjectStatusesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status or type to delete"
          },
          "replacementUUID": {
            "description": "Projects that use the one being deleted move to this one. Needed when any project uses it",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["uuid"]
      },
      "ProjectTypesListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of types per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort types by. Defaults to `name`",
            "type": "string",
            "enum": ["name"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ProjectTypesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, for example 'Dry hire'"
          },
          "sections": {
            "default": {},
            "description": "Which sections projects of the type show. Sections left out are on",
            "type": "object",
            "properties": {
              "assets": {
                "description": "Projects of this type can book assets. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "crew": {
                "description": "Projects of this type have crew. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "finance": {
                "description": "Projects of this type show prices, invoices and payments. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "files": {
                "description": "Projects of this type have files. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "notes": {
                "description": "Projects of this type have notes. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "client": {
                "description": "Projects of this type have a client. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "venue": {
                "description": "Projects of this type have a venue. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              }
            }
          },
          "isDefault": {
            "default": false,
            "description": "Make it the type new projects get",
            "type": "boolean"
          }
        },
        "required": ["name"]
      },
      "ProjectTypesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the type to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "sections": {
            "description": "Sections to turn on or off. Sections left out stay as they are. Omit to leave all unchanged",
            "type": "object",
            "properties": {
              "assets": {
                "description": "Projects of this type can book assets. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "crew": {
                "description": "Projects of this type have crew. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "finance": {
                "description": "Projects of this type show prices, invoices and payments. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "files": {
                "description": "Projects of this type have files. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "notes": {
                "description": "Projects of this type have notes. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "client": {
                "description": "Projects of this type have a client. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              },
              "venue": {
                "description": "Projects of this type have a venue. Omit to leave unchanged, or on for a new type",
                "type": "boolean"
              }
            }
          },
          "isDefault": {
            "description": "true makes it the type new projects get. To change the default, set it on another type",
            "type": "boolean",
            "const": true
          }
        },
        "required": ["uuid"]
      },
      "ProjectTypesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the status or type to delete"
          },
          "replacementUUID": {
            "description": "Projects that use the one being deleted move to this one. Needed when any project uses it",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["uuid"]
      },
      "ProjectsListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only projects whose name contains this text, or whose number is this",
            "type": "string",
            "maxLength": 255
          },
          "view": {
            "default": "ACTIVE",
            "description": "`ACTIVE` (the default) for projects at the enquiry, provisional or confirmed stage, `FINISHED`, `LOST`, or `ALL`",
            "type": "string",
            "enum": ["ACTIVE", "FINISHED", "LOST", "ALL"]
          },
          "statusUUID": {
            "description": "Only projects in this status",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "typeUUID": {
            "description": "Only projects of this type",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "clientUUID": {
            "description": "Only projects for this client",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "managerUUID": {
            "description": "Only projects managed by this member",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "parentUUID": {
            "description": "Only the sub-projects of this project",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "folderUUID": {
            "description": "Only the projects in this folder itself, not in folders inside it. null for the top-level projects in no folder",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "topLevel": {
            "default": false,
            "description": "Only top-level projects, leaving sub-projects out",
            "type": "boolean"
          },
          "from": {
            "description": "Only projects whose out or event period ends on or after this",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "to": {
            "description": "Only projects whose out or event period starts on or before this",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "deleted": {
            "default": false,
            "description": "true lists the projects in trash instead of the live ones. Needs permission to see deleted projects",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of projects per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "number",
            "description": "Field to sort projects by. Defaults to `number`",
            "type": "string",
            "enum": [
              "number",
              "name",
              "outStart",
              "eventStart",
              "createdAt",
              "updatedAt"
            ]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "ProjectsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "description": "UUID of the project. Give this or `number`",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "number": {
            "description": "The project's number. Give this or `uuid`",
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          }
        }
      },
      "ProjectsCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "The project's name, for example 'Summer ball 2027'"
          },
          "description": {
            "description": "What the project is, in more detail",
            "type": "string",
            "maxLength": 10000
          },
          "statusUUID": {
            "description": "UUID of its status. Omit for the default status",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "typeUUID": {
            "description": "UUID of its type. Omit for the default type",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "parentUUID": {
            "description": "UUID of the project to make it a sub-project of. Sub-projects nest at most three levels deep",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "followParentStatus": {
            "default": false,
            "description": "For a sub-project: keep its status the same as its parent's. Ignored for a top-level project",
            "type": "boolean"
          },
          "managerUUID": {
            "description": "UUID of the member managing it. Omit for yourself",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "folderUUID": {
            "description": "UUID of the folder to put it in. Ignored for a sub-project, which goes where its parent goes",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "clientUUID": {
            "description": "UUID of the client it's for",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "clientContactUUID": {
            "description": "UUID of the person at the client it's with",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "venueUUID": {
            "description": "UUID of the location where it happens",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "outStart": {
            "description": "When the assets leave, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "outEnd": {
            "description": "When the assets are back, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "eventStart": {
            "description": "When the event starts, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "eventEnd": {
            "description": "When the event ends, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "chargeStart": {
            "description": "Start of the charged period. Null charges for the out period, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "chargeEnd": {
            "description": "End of the charged period. Null charges for the out period, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "clientPricingUUID": {
            "description": "UUID of the client pricing to price lines through. Omit for the client's own",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "defaultDiscountBp": {
            "description": "The discount new lines get, in basis points: 1000 is 10%",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "unitsOverride": {
            "description": "Chargeable units for every line, instead of working them out from the dates. 0 is free",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "taxRateOverrideUUID": {
            "description": "UUID of a tax rate every line is taxed at instead of its own",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "invoiceNotes": {
            "description": "Printed on the project's quotes and invoices",
            "type": "string",
            "maxLength": 5000
          },
          "deliveryNotes": {
            "description": "Printed on the project's delivery notes",
            "type": "string",
            "maxLength": 5000
          },
          "followerUUIDs": {
            "default": [],
            "description": "UUIDs of members to follow the project. The manager follows it too",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "templateUUID": {
            "description": "UUID of a project template to start it from: its lines are added and priced, each crew role becomes a vacancy not yet taking applications, and its notes are copied. The project gets the template's type unless typeUUID is given. Lines whose item has since been deleted are left out",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "number": {
            "description": "The project number to use, for a project brought across from another system. Ignored if another project has it. Omit for the next number",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000000
          },
          "createdByUUID": {
            "description": "Only for the import from the previous version of AdamRMS: who created the project there. Ignored otherwise",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "createdAt": {
            "description": "Only for the import from the previous version of AdamRMS: when the project was created there. Ignored otherwise",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": ["name"]
      },
      "ProjectsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "statusUUID": {
            "description": "UUID of its new status. Sub-projects that follow its status change with it. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "typeUUID": {
            "description": "UUID of its new type. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "parentUUID": {
            "description": "UUID of the project to move it under, or null to make it a top-level project. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "followParentStatus": {
            "description": "Keep its status the same as its parent's. Turning it on takes the parent's status now. Omit to leave unchanged",
            "type": "boolean"
          },
          "managerUUID": {
            "description": "UUID of the member managing it, or null for nobody. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "folderUUID": {
            "description": "UUID of the folder to move it to, or null to take it out of its folder. Ignored for a sub-project. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "clientUUID": {
            "description": "UUID of the client, or null for none. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "clientContactUUID": {
            "description": "UUID of the person at the client, or null for none. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "venueUUID": {
            "description": "UUID of the venue, or null for none. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "outStart": {
            "description": "When the assets leave, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "outEnd": {
            "description": "When the assets are back, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "eventStart": {
            "description": "When the event starts, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "eventEnd": {
            "description": "When the event ends, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "chargeStart": {
            "description": "Start of the charged period. Null charges for the out period, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "chargeEnd": {
            "description": "End of the charged period. Null charges for the out period, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "clientPricingUUID": {
            "description": "UUID of the client pricing to price new lines through, or null for catalogue prices. Lines already on it keep their prices until refreshed. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultDiscountBp": {
            "description": "The discount new lines get, in basis points. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "unitsOverride": {
            "description": "Chargeable units for every line, or null to work them out from the dates. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxRateOverrideUUID": {
            "description": "UUID of a tax rate every line is taxed at, or null for each line's own. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "invoiceNotes": {
            "description": "Printed on quotes and invoices, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveryNotes": {
            "description": "Printed on delivery notes, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ProjectsFollowInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          },
          "userUUID": {
            "description": "UUID of the member. Omit for yourself",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "following": {
            "type": "boolean",
            "description": "true to start following the project, false to stop"
          }
        },
        "required": ["uuid", "following"]
      },
      "ProjectsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project to move to trash"
          }
        },
        "required": ["uuid"]
      },
      "ProjectsRestoreInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project in trash to restore"
          }
        },
        "required": ["uuid"]
      },
      "ProjectNotesListInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of notes per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort notes by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt", "title"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["projectUUID"]
      },
      "ProjectsHistoryInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          },
          "before": {
            "description": "Only return changes made before this time: the nextBefore of the previous page",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "limit": {
            "default": 25,
            "description": "How many changes to return, 1 to 50",
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        },
        "required": ["projectUUID"]
      },
      "ProjectNotesCreateInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The note's title, for example 'Site visit'"
          },
          "body": {
            "default": "",
            "description": "The note, in Markdown",
            "type": "string",
            "maxLength": 50000
          },
          "authorUUID": {
            "description": "Only for the import from the previous version of AdamRMS: who wrote it there. Ignored otherwise",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["projectUUID", "title"]
      },
      "ProjectNotesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the note"
          },
          "title": {
            "description": "New title. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "body": {
            "description": "New text, in Markdown. Omit to leave unchanged",
            "type": "string",
            "maxLength": 50000
          }
        },
        "required": ["uuid"]
      },
      "ProjectNotesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the note to delete"
          }
        },
        "required": ["uuid"]
      },
      "ProjectFoldersListInput": {
        "type": "object",
        "properties": {}
      },
      "ProjectFoldersCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The folder's name, for example 'Weddings'"
          },
          "parentUUID": {
            "description": "UUID of the folder to put it in. Omit for a top-level folder. Folders nest at most 5 levels deep",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["name"]
      },
      "ProjectFoldersUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the folder to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "parentUUID": {
            "description": "UUID of the folder to move it into, or null to make it a top-level folder. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ProjectFoldersDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the folder to delete"
          }
        },
        "required": ["uuid"]
      },
      "InspectionTemplatesListInput": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "description": "Only templates that apply to this asset type",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of templates per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort templates by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "InspectionTemplatesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template"
          }
        },
        "required": ["uuid"]
      },
      "InspectionTemplatesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, for example 'PAT' or 'LOLER thorough examination'"
          },
          "description": {
            "description": "What the inspection is",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "intervalValue": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "How often it's due, with `intervalUnit`: for example 12"
          },
          "intervalUnit": {
            "type": "string",
            "enum": ["DAYS", "WEEKS", "MONTHS", "YEARS"],
            "description": "`DAYS`, `WEEKS`, `MONTHS` or `YEARS`"
          },
          "whenOverdue": {
            "default": "FLAG",
            "description": "`BLOCK`: an overdue or failed asset can't be booked. `FLAG`: it only shows a warning",
            "type": "string",
            "enum": ["BLOCK", "FLAG"]
          },
          "passNewAssets": {
            "default": false,
            "description": "New assets count as passed when they're added, so they're first due one interval later",
            "type": "boolean"
          },
          "checkOnReturn": {
            "default": false,
            "description": "Check each asset when it comes back from a project: it's due from the moment it's marked back, until it's inspected again",
            "type": "boolean"
          },
          "items": {
            "default": [],
            "description": "The checklist, in order, at most 50 lines",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "description": "UUID of an existing line, to keep it (and its history). Omit for a new line",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "description": "What to check, for example 'Insulation resistance'"
                },
                "help": {
                  "description": "How to check it, shown to the tester",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 1000
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": ["TEXT", "NUMBER", "BOOLEAN", "SELECT"],
                  "description": "`TEXT` (a note), `NUMBER` (a reading), `BOOLEAN` (yes or no) or `SELECT` (one of a list)"
                },
                "required": {
                  "default": true,
                  "description": "The tester must answer it. Defaults to true",
                  "type": "boolean"
                },
                "min": {
                  "description": "NUMBER: a reading below this fails the line",
                  "type": ["number", "null"]
                },
                "max": {
                  "description": "NUMBER: a reading above this fails the line",
                  "type": ["number", "null"]
                },
                "unit": {
                  "description": "NUMBER: what the reading is in, for example 'MΩ'",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 20
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "expected": {
                  "description": "BOOLEAN: the answer that passes, for example true for 'Cable undamaged?'. Omit for one that never fails",
                  "type": ["boolean", "null"]
                },
                "options": {
                  "description": "SELECT: the choices, at most 20",
                  "anyOf": [
                    {
                      "minItems": 1,
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100,
                            "description": "What the tester picks, for example 'Damaged'"
                          },
                          "fails": {
                            "default": false,
                            "description": "Choosing this fails the line",
                            "type": "boolean"
                          }
                        },
                        "required": ["label"]
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": ["label", "type"]
            }
          },
          "assetTypeUUIDs": {
            "default": [],
            "description": "UUIDs of the asset types it applies to. Only individually tracked types can be inspected",
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["name", "intervalValue", "intervalUnit"]
      },
      "InspectionTemplatesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "intervalValue": {
            "description": "New interval. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "intervalUnit": {
            "description": "New interval unit. Omit to leave unchanged",
            "type": "string",
            "enum": ["DAYS", "WEEKS", "MONTHS", "YEARS"]
          },
          "whenOverdue": {
            "description": "BLOCK or FLAG. Omit to leave unchanged",
            "type": "string",
            "enum": ["BLOCK", "FLAG"]
          },
          "passNewAssets": {
            "description": "Omit to leave unchanged",
            "type": "boolean"
          },
          "checkOnReturn": {
            "description": "Omit to leave unchanged",
            "type": "boolean"
          },
          "items": {
            "description": "The whole new checklist, in order. Lines given with a `uuid` are kept; lines left out are removed (older results still show them). Omit to leave unchanged",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "description": "UUID of an existing line, to keep it (and its history). Omit for a new line",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "description": "What to check, for example 'Insulation resistance'"
                },
                "help": {
                  "description": "How to check it, shown to the tester",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 1000
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": ["TEXT", "NUMBER", "BOOLEAN", "SELECT"],
                  "description": "`TEXT` (a note), `NUMBER` (a reading), `BOOLEAN` (yes or no) or `SELECT` (one of a list)"
                },
                "required": {
                  "default": true,
                  "description": "The tester must answer it. Defaults to true",
                  "type": "boolean"
                },
                "min": {
                  "description": "NUMBER: a reading below this fails the line",
                  "type": ["number", "null"]
                },
                "max": {
                  "description": "NUMBER: a reading above this fails the line",
                  "type": ["number", "null"]
                },
                "unit": {
                  "description": "NUMBER: what the reading is in, for example 'MΩ'",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 20
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "expected": {
                  "description": "BOOLEAN: the answer that passes, for example true for 'Cable undamaged?'. Omit for one that never fails",
                  "type": ["boolean", "null"]
                },
                "options": {
                  "description": "SELECT: the choices, at most 20",
                  "anyOf": [
                    {
                      "minItems": 1,
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100,
                            "description": "What the tester picks, for example 'Damaged'"
                          },
                          "fails": {
                            "default": false,
                            "description": "Choosing this fails the line",
                            "type": "boolean"
                          }
                        },
                        "required": ["label"]
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": ["label", "type"]
            }
          },
          "assetTypeUUIDs": {
            "description": "The whole new list of asset types. Omit to leave unchanged",
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["uuid"]
      },
      "InspectionTemplatesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template to delete"
          }
        },
        "required": ["uuid"]
      },
      "InspectionsRecordInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset inspected"
          },
          "templateUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the inspection template"
          },
          "answers": {
            "default": [],
            "description": "Answers to the template's checklist",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "itemUUID": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "UUID of the checklist line"
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 1000
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The answer: text, a number such as `0.08`, `true`/`false`, or a choice's label. Null to leave it blank"
                }
              },
              "required": ["itemUUID", "value"]
            }
          },
          "passOverride": {
            "description": "true passes the asset although a line failed, false fails it although every line passed. Needs `overrideNote` when it passes a failed line. Omit to go by the lines",
            "type": "boolean"
          },
          "overrideNote": {
            "description": "Why the result differs from the lines",
            "type": "string",
            "maxLength": 1000
          },
          "testedAt": {
            "description": "When it was tested. Omit for now. Can't be in the future",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "testerUUID": {
            "description": "UUID of the member who tested it. Omit for yourself, unless `testerName` is given",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "testerName": {
            "description": "Name of a tester from outside, such as a LOLER examiner",
            "type": "string",
            "maxLength": 255
          },
          "testerCompany": {
            "description": "Company of a tester from outside",
            "type": "string",
            "maxLength": 255
          },
          "certificateNumber": {
            "description": "The certificate or report number",
            "type": "string",
            "maxLength": 100
          },
          "testEquipment": {
            "description": "The test equipment used, for example 'Seaward Apollo 600, serial 1234'",
            "type": "string",
            "maxLength": 255
          },
          "notes": {
            "description": "Notes on the test",
            "type": "string",
            "maxLength": 5000
          },
          "scanUUID": {
            "description": "UUID of the scan the result goes with, when tested in a scan session",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["assetUUID", "templateUUID"]
      },
      "InspectionsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the result"
          }
        },
        "required": ["uuid"]
      },
      "InspectionsListInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "description": "Only results for this asset",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "templateUUID": {
            "description": "Only results of this template",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "passed": {
            "description": "Only passes (true) or only failures (false)",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of results per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "testedAt",
            "description": "Field to sort results by. Defaults to `testedAt`",
            "type": "string",
            "enum": ["testedAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "InspectionsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the result to delete"
          }
        },
        "required": ["uuid"]
      },
      "InspectionsAssetStatusInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          }
        },
        "required": ["assetUUID"]
      },
      "InspectionsDueInput": {
        "type": "object",
        "properties": {
          "templateUUID": {
            "description": "Only this inspection",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "dueBefore": {
            "description": "Only assets due before this time. Omit for 14 days from now",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of assets due per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "dueAt",
            "description": "Field to sort assets due by. Defaults to `dueAt`",
            "type": "string",
            "enum": ["dueAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "InspectionsReturnChecksInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project. Its sub-projects' assets are included"
          }
        },
        "required": ["projectUUID"]
      },
      "InspectionsSetAssetOverrideInput": {
        "type": "object",
        "properties": {
          "assetUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the asset"
          },
          "templateUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template"
          },
          "excluded": {
            "default": false,
            "description": "Leave this asset out of the inspection altogether",
            "type": "boolean"
          },
          "intervalValue": {
            "default": null,
            "description": "The asset's own interval, or null to use the template's",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "intervalUnit": {
            "default": null,
            "description": "Unit of the asset's own interval. Needed with `intervalValue`",
            "anyOf": [
              {
                "type": "string",
                "enum": ["DAYS", "WEEKS", "MONTHS", "YEARS"]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["assetUUID", "templateUUID"]
      },
      "DocumentTemplatesListInput": {
        "type": "object",
        "properties": {
          "kind": {
            "description": "Only return templates of this kind. What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)",
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ]
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of document templates per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort document templates by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "DocumentTemplatesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template"
          }
        },
        "required": ["uuid"]
      },
      "DocumentTemplatesCreateInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Display name, such as 'PAT certificate'"
          },
          "isDefault": {
            "description": "Make it the default for its kind, in place of the current one. The first template of a kind is always the default",
            "type": "boolean"
          },
          "paperSize": {
            "description": "Paper size: `A4` (210 × 297 mm) or `LETTER` (8.5 × 11 in). Defaults to Letter in the Americas and A4 elsewhere, from the organisation's timezone",
            "type": "string",
            "enum": ["A4", "LETTER"]
          },
          "settings": {
            "description": "Settings. Any left out take their defaults",
            "type": "object",
            "properties": {
              "title": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 200
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The title printed on the document, such as 'Tax invoice'. Null uses the kind's own title"
              },
              "introText": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 5000
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Text printed under the title, or null for none"
              },
              "footerText": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 5000
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Text printed at the end, such as terms or payment details, or null for none"
              },
              "accentColour": {
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$",
                "description": "Colour for headings and lines, as #rrggbb"
              },
              "font": {
                "type": "string",
                "enum": ["SANS", "SERIF", "MONO"],
                "description": "Font: `SANS` (Arial), `SERIF` (Georgia) or `MONO` (Courier New)"
              },
              "showLogo": {
                "type": "boolean",
                "description": "Print the organisation's logo at the top"
              }
            }
          },
          "html": {
            "description": "Liquid HTML for the document's body, up to 200,000 characters. It reads the kind's data, such as `{{ organisation.name }}`, and the filters `money`, `date`, `datetime` and `mass`. It can't run JavaScript or load anything from the internet: images must be `data:` URLs. Null uses the kind's built-in layout, adjusted by the settings. Defaults to null",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["kind", "name"]
      },
      "DocumentTemplatesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template to update"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "isDefault": {
            "description": "True to make it the default for its kind. To change the default, make another template the default",
            "type": "boolean",
            "const": true
          },
          "paperSize": {
            "description": "Paper size: `A4` (210 × 297 mm) or `LETTER` (8.5 × 11 in). Omit to leave unchanged",
            "type": "string",
            "enum": ["A4", "LETTER"]
          },
          "settings": {
            "description": "Settings to change. Any left out are unchanged",
            "type": "object",
            "properties": {
              "title": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 200
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The title printed on the document, such as 'Tax invoice'. Null uses the kind's own title"
              },
              "introText": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 5000
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Text printed under the title, or null for none"
              },
              "footerText": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 5000
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Text printed at the end, such as terms or payment details, or null for none"
              },
              "accentColour": {
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$",
                "description": "Colour for headings and lines, as #rrggbb"
              },
              "font": {
                "type": "string",
                "enum": ["SANS", "SERIF", "MONO"],
                "description": "Font: `SANS` (Arial), `SERIF` (Georgia) or `MONO` (Courier New)"
              },
              "showLogo": {
                "type": "boolean",
                "description": "Print the organisation's logo at the top"
              }
            }
          },
          "html": {
            "description": "Liquid HTML for the document's body, up to 200,000 characters. It reads the kind's data, such as `{{ organisation.name }}`, and the filters `money`, `date`, `datetime` and `mass`. It can't run JavaScript or load anything from the internet: images must be `data:` URLs. Null uses the kind's built-in layout, adjusted by the settings. Null goes back to the built-in layout. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "DocumentTemplatesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the template to delete. Documents already made from it are kept. If it was the default, the oldest remaining template of its kind becomes the default"
          }
        },
        "required": ["uuid"]
      },
      "DocumentsPreviewInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "templateUUID": {
            "description": "UUID of a saved template of this kind. Omit to preview `draft`, or the kind's default",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "draft": {
            "description": "An unsaved template to preview, as the editor has it. Ignored when `templateUUID` is given",
            "type": "object",
            "properties": {
              "paperSize": {
                "type": "string",
                "enum": ["A4", "LETTER"],
                "description": "Paper size: `A4` (210 × 297 mm) or `LETTER` (8.5 × 11 in)"
              },
              "settings": {
                "$ref": "#/components/schemas/DocumentTemplateSettings"
              },
              "html": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 200000
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Liquid HTML for the document's body, up to 200,000 characters. It reads the kind's data, such as `{{ organisation.name }}`, and the filters `money`, `date`, `datetime` and `mass`. It can't run JavaScript or load anything from the internet: images must be `data:` URLs. Null uses the kind's built-in layout, adjusted by the settings"
              }
            },
            "required": ["paperSize", "settings", "html"]
          },
          "recordUUID": {
            "description": "UUID of a real record to preview with, such as an inspection result. Omit to use sample data",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["kind"]
      },
      "DocumentsCreateInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "recordUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of what the document is about, for the kind: for `INSPECTION_CERTIFICATE`, the inspection result; for `INVOICE`, the invoice; for `QUOTE`, the quote; for `DELIVERY_NOTE`, `PICKING_LIST`, `RETURN_NOTE`, `CREW_CALL_SHEET` and `PROJECT_NOTES`, the project; for `CLIENT_STATEMENT`, the client"
          },
          "templateUUID": {
            "description": "UUID of the template to use. Omit for the kind's default, or its built-in layout when it has no templates",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["kind", "recordUUID"]
      },
      "DocumentsListInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "recordUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of what the documents are about, for the kind: for `INSPECTION_CERTIFICATE`, the inspection result; for `INVOICE`, the invoice; for `QUOTE`, the quote; for `DELIVERY_NOTE`, `PICKING_LIST`, `RETURN_NOTE`, `CREW_CALL_SHEET` and `PROJECT_NOTES`, the project; for `CLIENT_STATEMENT`, the client"
          }
        },
        "required": ["kind", "recordUUID"]
      },
      "DocumentsListForProjectInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project. Documents made for its sub-projects are included"
          }
        },
        "required": ["projectUUID"]
      },
      "DocumentsEmailInput": {
        "type": "object",
        "properties": {
          "fileUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of a document kept on a project (the fileUUID from documents.create or documents.list-for-project)"
          },
          "contactUUIDs": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUIDs of the project's client's contacts to send it to (from client-contacts.list). Each needs an email address"
          },
          "message": {
            "description": "A message to the client, in plain text, shown above the attachment. Omit for none",
            "type": "string",
            "maxLength": 5000
          }
        },
        "required": ["fileUUID", "contactUUIDs"]
      },
      "DocumentsCreateBatchInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "recordUUIDs": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUIDs of what each document is about, as for documents.create, such as projects for delivery notes. Up to 100; repeats are ignored"
          },
          "templateUUID": {
            "description": "UUID of the template to use for every document. Omit for the kind's default",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["kind", "recordUUIDs"]
      },
      "DocumentsGetBatchInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the batch, from documents.create-batch"
          }
        },
        "required": ["uuid"]
      },
      "DocumentSettingsGetInput": {
        "type": "object",
        "properties": {}
      },
      "DocumentSettingsUpdateInput": {
        "type": "object",
        "properties": {
          "showAdamRMSFooter": {
            "description": "True to say on every document that it was made with AdamRMS, false to leave it off. Omit to leave unchanged",
            "type": "boolean"
          }
        }
      },
      "CertificationTypesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return types whose name contains this text",
            "type": "string",
            "maxLength": 255
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of certification types per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort certification types by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "CertificationTypesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "What it is called, such as 'IPAF 3a' or 'First aid at work'. Must not match another live type's name (ignoring case)"
          },
          "description": {
            "description": "What it covers, such as which machines or which course",
            "type": "string",
            "maxLength": 2000
          },
          "validityMonths": {
            "description": "How many months a certification lasts once gained, such as 60 for five years. Omit if it never expires",
            "type": "integer",
            "minimum": 1,
            "maximum": 600
          }
        },
        "required": ["name"]
      },
      "CertificationTypesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the certification type to change"
          },
          "name": {
            "description": "New name. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "New description, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "validityMonths": {
            "description": "New validity in months, or null for one that never expires. Certifications already recorded keep their expiry date. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 600
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "CertificationTypesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the certification type to delete"
          }
        },
        "required": ["uuid"]
      },
      "MemberCertificationsListInput": {
        "type": "object",
        "properties": {
          "memberUUID": {
            "description": "Only this member's certifications. Anyone can list their own; everyone else's needs permission to view members' certifications",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "typeUUID": {
            "description": "Only certifications of this type",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "status": {
            "description": "Only certifications in this state. Omit for all but revoked",
            "type": "string",
            "enum": ["VALID", "EXPIRING", "EXPIRED", "UNVERIFIED", "REVOKED"]
          },
          "includeRevoked": {
            "default": false,
            "description": "Also return revoked certifications, when no status is given",
            "type": "boolean"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of certifications per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "expiresOn",
            "description": "Field to sort certifications by. Defaults to `expiresOn`",
            "type": "string",
            "enum": ["gainedOn", "expiresOn", "createdAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "MemberCertificationsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the certification"
          }
        },
        "required": ["uuid"]
      },
      "MemberCertificationsCreateInput": {
        "type": "object",
        "properties": {
          "memberUUID": {
            "description": "UUID of the member who holds it. Omit for yourself. Recording one for someone else needs permission, and is verified at once; one you add for yourself without that permission is unverified until someone verifies it",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "typeUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of its certification type"
          },
          "gainedOn": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "The day it was gained, YYYY-MM-DD"
          },
          "expiresOn": {
            "description": "The last day it is valid, YYYY-MM-DD. Omit to work it out from the type's validity; null for one that never expires",
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "issuedBy": {
            "description": "Who issued it, such as 'IPAF' or a training company",
            "type": "string",
            "maxLength": 200
          },
          "reference": {
            "description": "The card or certificate number",
            "type": "string",
            "maxLength": 200
          },
          "comment": {
            "description": "Notes about it",
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": ["typeUUID", "gainedOn"]
      },
      "MemberCertificationsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the certification to change"
          },
          "typeUUID": {
            "description": "New certification type",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "gainedOn": {
            "description": "New day it was gained, YYYY-MM-DD. Omit to leave unchanged",
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "expiresOn": {
            "description": "New expiry day, or null for one that never expires. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "issuedBy": {
            "description": "New issuer, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "reference": {
            "description": "New card or certificate number, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "comment": {
            "description": "New notes, or null to clear them",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "MemberCertificationsVerifyInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the unverified certification to verify"
          }
        },
        "required": ["uuid"]
      },
      "MemberCertificationsRevokeInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the certification to revoke"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Why it no longer counts, such as 'Card lost' or 'Retraining needed'"
          }
        },
        "required": ["uuid", "reason"]
      },
      "MemberCertificationsRevokeAllInput": {
        "type": "object",
        "properties": {
          "typeUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the certification type whose certifications to revoke"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Why they no longer count, such as 'The course changed'"
          }
        },
        "required": ["typeUUID", "reason"]
      },
      "MemberCertificationsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the unverified certification to delete"
          }
        },
        "required": ["uuid"]
      },
      "MemberCertificationsCheckInput": {
        "type": "object",
        "properties": {
          "memberUUIDs": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "The members to check, at most 100"
          },
          "typeUUIDs": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "The certification types each must hold, at most 50"
          },
          "validOn": {
            "description": "The day they must be valid on, YYYY-MM-DD, such as the last day of a project. Defaults to today",
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          }
        },
        "required": ["memberUUIDs", "typeUUIDs"]
      },
      "MemberCertificationsStartEvidenceUploadInput": {
        "type": "object",
        "properties": {
          "certificationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the certification it is evidence for"
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "The file's name, such as 'ipaf-card.jpg'"
          },
          "contentType": {
            "type": "string",
            "enum": [
              "application/pdf",
              "image/jpeg",
              "image/png",
              "image/webp"
            ],
            "description": "The file's type: a PDF, JPEG, PNG or WebP"
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "Its size in bytes, at most 26214400"
          }
        },
        "required": [
          "certificationUUID",
          "fileName",
          "contentType",
          "sizeBytes"
        ]
      },
      "MemberCertificationsFinishEvidenceUploadInput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The token start-evidence-upload returned"
          }
        },
        "required": ["uploadToken"]
      },
      "MemberCertificationsRemoveEvidenceInput": {
        "type": "object",
        "properties": {
          "fileUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the evidence file to remove"
          }
        },
        "required": ["fileUUID"]
      },
      "TrainingModulesListInput": {
        "type": "object",
        "properties": {
          "search": {
            "description": "Only return modules whose name contains this text",
            "type": "string",
            "maxLength": 255
          },
          "published": {
            "default": "ALL",
            "description": "Which modules to return. Members who can't edit modules only ever see published ones",
            "type": "string",
            "enum": ["PUBLISHED", "DRAFT", "ALL"]
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of training modules per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "name",
            "description": "Field to sort training modules by. Defaults to `name`",
            "type": "string",
            "enum": ["name", "createdAt", "updatedAt"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "TrainingModulesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the module"
          }
        },
        "required": ["uuid"]
      },
      "TrainingModulesCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "What it is called, such as 'Rigging moving heads safely'"
          },
          "description": {
            "description": "One or two sentences on what it is about",
            "type": "string",
            "maxLength": 5000
          },
          "learningObjectives": {
            "description": "What members will be able to do once they finish, in Markdown",
            "type": "string",
            "maxLength": 5000
          },
          "icon": {
            "description": "Icon reference: `tabler:<name>` or `custom:<uuid>`",
            "type": "string",
            "maxLength": 100
          },
          "type": {
            "type": "string",
            "enum": ["ONLINE", "HYBRID", "IN_PERSON"],
            "description": "ONLINE: members work through the steps, and finishing them awards the certification. HYBRID: members work through the steps, then someone signs them off. IN_PERSON: there are no steps to finish; someone signs members off after training them"
          },
          "published": {
            "default": false,
            "description": "Whether members can see it straight away. Defaults to a draft",
            "type": "boolean"
          },
          "certificationTypeUUID": {
            "description": "UUID of the certification type it awards. Needed for HYBRID and IN_PERSON modules",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "roleUUIDs": {
            "default": [],
            "description": "Roles that may see it. Empty for every member",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["name", "type"]
      },
      "TrainingModulesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the module to change"
          },
          "name": {
            "description": "New name",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "description": "New description, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "learningObjectives": {
            "description": "New learning objectives, or null to clear them",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "icon": {
            "description": "New icon, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "description": "New type: ONLINE, HYBRID or IN_PERSON. Omit to leave unchanged",
            "type": "string",
            "enum": ["ONLINE", "HYBRID", "IN_PERSON"]
          },
          "published": {
            "description": "Publish it, or make it a draft",
            "type": "boolean"
          },
          "certificationTypeUUID": {
            "description": "UUID of the certification type it awards, or null for none (only for ONLINE modules)",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "roleUUIDs": {
            "description": "Roles that may see it, replacing the current ones. Empty for every member",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["uuid"]
      },
      "TrainingModulesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the module to delete"
          }
        },
        "required": ["uuid"]
      },
      "TrainingModulesProgressInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the module"
          },
          "filter": {
            "default": "ALL",
            "description": "ALL, IN_PROGRESS (started, not finished), READY_FOR_SIGN_OFF (finished a HYBRID module, not yet certified) or COMPLETED",
            "type": "string",
            "enum": ["ALL", "IN_PROGRESS", "READY_FOR_SIGN_OFF", "COMPLETED"]
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of members per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "updatedAt",
            "description": "Field to sort members by. Defaults to `updatedAt`",
            "type": "string",
            "enum": ["updatedAt", "startedAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["uuid"]
      },
      "TrainingModulesSignOffInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the module"
          },
          "memberUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the member to sign off"
          },
          "comment": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "How they showed they can do it, such as 'Rigged four heads on the truss with me'"
          },
          "gainedOn": {
            "description": "The day they were signed off, YYYY-MM-DD. Defaults to today",
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          }
        },
        "required": ["uuid", "memberUUID", "comment"]
      },
      "TrainingStepsCreateInput": {
        "type": "object",
        "properties": {
          "moduleUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the module to add the step to, at the end"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The step's title, such as 'Checking the safety bond'"
          },
          "type": {
            "type": "string",
            "enum": ["TEXT", "VIDEO"],
            "description": "TEXT or VIDEO"
          },
          "content": {
            "default": "",
            "description": "Markdown: the step's text, or for a video what shows under it. Images are `![name](file:<uuid>)`, files of the module",
            "type": "string",
            "maxLength": 50000
          },
          "video": {
            "description": "For a VIDEO step: the YouTube video's address or ID",
            "type": "string",
            "maxLength": 500
          },
          "estimatedMinutes": {
            "default": 0,
            "description": "Roughly how many minutes it takes",
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "internalNotes": {
            "description": "Notes only editors see",
            "type": "string",
            "maxLength": 5000
          },
          "published": {
            "default": true,
            "description": "Whether members see it",
            "type": "boolean"
          }
        },
        "required": ["moduleUUID", "name", "type"]
      },
      "TrainingStepsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the step to change"
          },
          "name": {
            "description": "New title. Omit to leave unchanged",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "type": {
            "description": "New type: TEXT or VIDEO. Omit to leave unchanged",
            "type": "string",
            "enum": ["TEXT", "VIDEO"]
          },
          "content": {
            "description": "New Markdown text. Omit to leave unchanged",
            "type": "string",
            "maxLength": 50000
          },
          "video": {
            "description": "The YouTube video's address or ID, or null to clear it",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "estimatedMinutes": {
            "description": "New estimated minutes. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "internalNotes": {
            "description": "New notes only editors see, or null to clear them",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "published": {
            "description": "Whether members see it. Omit to leave unchanged",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "TrainingStepsMoveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the step to move"
          },
          "direction": {
            "type": "string",
            "enum": ["UP", "DOWN"],
            "description": "Earlier (UP) or later (DOWN)"
          }
        },
        "required": ["uuid", "direction"]
      },
      "TrainingStepsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the step to delete"
          }
        },
        "required": ["uuid"]
      },
      "TrainingStepsCompleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the step the caller has done"
          }
        },
        "required": ["uuid"]
      },
      "FinanceSettingsGetInput": {
        "type": "object",
        "properties": {}
      },
      "FinanceSettingsUpdateInput": {
        "type": "object",
        "properties": {
          "invoicePrefix": {
            "description": "Put before invoice numbers, such as 'INV-' for INV-0001. Deposit invoices share the sequence. Omit to leave unchanged",
            "type": "string",
            "maxLength": 20,
            "pattern": "^[A-Za-z0-9 /_.#-]*$"
          },
          "nextInvoiceNumber": {
            "description": "The number the next invoice gets. It can't go back to a number already used. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 999999999
          },
          "creditNotePrefix": {
            "description": "Put before credit note numbers, such as 'CN-' for CN-0001. Omit to leave unchanged",
            "type": "string",
            "maxLength": 20,
            "pattern": "^[A-Za-z0-9 /_.#-]*$"
          },
          "nextCreditNoteNumber": {
            "description": "The number the next credit note gets. It can't go back to a number already used. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 999999999
          },
          "quotePrefix": {
            "description": "Put before quote numbers, such as 'QUO-' for QUO-0001. Omit to leave unchanged",
            "type": "string",
            "maxLength": 20,
            "pattern": "^[A-Za-z0-9 /_.#-]*$"
          },
          "nextQuoteNumber": {
            "description": "The number the next quote gets. It can't go back to a number already used. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 999999999
          },
          "numberDigits": {
            "description": "How many digits numbers are padded to with leading zeros, such as 4 for 0001. Omit to leave unchanged",
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "paymentTermsDays": {
            "description": "Days from issuing an invoice to when it's due, such as 30. 0 makes invoices due on issue. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "quoteValidDays": {
            "description": "Days a quote is valid for after it's issued, such as 30. 0 for quotes with no expiry. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "depositBp": {
            "description": "The deposit a deposit invoice asks for by default, as a share of the project's total in basis points (2500 is 25%). 0 for none. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "linkedDiscountBp": {
            "description": "The discount on assets that go out because they're in a case that was added to a project, in basis points (10000 is 100%, so they're free). Applies to assets added from now on, not those already on projects. Omit to leave unchanged",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          }
        }
      },
      "ProjectFinanceGetInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project. Its sub-projects are included"
          }
        },
        "required": ["projectUUID"]
      },
      "ClientFinanceListInput": {
        "type": "object",
        "properties": {
          "clientUUIDs": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "UUIDs of the clients to total, such as a page of clients.list. At most 100"
          }
        },
        "required": ["clientUUIDs"]
      },
      "ClientStatementsGetInput": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the client, from clients.list"
          },
          "from": {
            "description": "Start of the statement, as an ISO 8601 date and time. Everything before it is added up into the opening balance. Omit to start from the first invoice",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "to": {
            "description": "End of the statement: only what's dated before this is on it. Omit for up to now",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": ["clientUUID"]
      },
      "PaymentMethodsListInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of payment methods per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "position",
            "description": "Field to sort payment methods by. Defaults to `position`",
            "type": "string",
            "enum": ["position", "name"]
          },
          "direction": {
            "default": "asc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `asc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "PaymentMethodsCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, such as 'Bank transfer' or 'Card'"
          }
        },
        "required": ["name"]
      },
      "PaymentMethodsUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the payment method to change"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Display name, such as 'Bank transfer' or 'Card'"
          }
        },
        "required": ["uuid", "name"]
      },
      "PaymentMethodsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the payment method to delete. Payments already recorded with it keep it"
          }
        },
        "required": ["uuid"]
      },
      "PaymentsListInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "description": "Only payments on this project and its sub-projects. Omit for the whole organisation's ledger",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "clientUUID": {
            "description": "Only payments on this client's projects and their sub-projects. Sub-clients' projects aren't included",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "invoiceUUID": {
            "description": "Only payments of this invoice",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "kinds": {
            "description": "Only these kinds. Omit for every kind",
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "PAYMENT",
                "REFUND",
                "DEPOSIT_TAKEN",
                "DEPOSIT_RETURNED",
                "DEPOSIT_RETAINED"
              ]
            }
          },
          "search": {
            "description": "Only payments whose reference or comment contains this text (case-insensitive), or whose amount in the smallest currency unit is this number",
            "type": "string",
            "maxLength": 255
          },
          "from": {
            "description": "Only payments on or after this date and time",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "to": {
            "description": "Only payments before this date and time",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of payments per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "date",
            "description": "Field to sort payments by. Defaults to `date`",
            "type": "string",
            "enum": ["date", "amount", "createdAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "PaymentsGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the payment"
          }
        },
        "required": ["uuid"]
      },
      "PaymentsRecordInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "description": "UUID of the project it was paid on. Omit when giving an invoice: its project is used",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "invoiceUUID": {
            "description": "UUID of the issued invoice it pays or refunds. Only for PAYMENT and REFUND",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "kind": {
            "type": "string",
            "enum": ["PAYMENT", "REFUND", "DEPOSIT_TAKEN", "DEPOSIT_RETURNED"],
            "description": "PAYMENT, REFUND, DEPOSIT_TAKEN or DEPOSIT_RETURNED. Keep part of a deposit with payments.retain-deposit"
          },
          "amount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000000000,
            "description": "How much, in the smallest currency unit (such as pence). Always positive: the kind says which way it went"
          },
          "date": {
            "description": "When the money was paid, as an ISO 8601 date and time. Omit for now",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "methodUUID": {
            "description": "UUID of how it was paid, from payment-methods.list. Omit if not known",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "reference": {
            "description": "A reference, such as the bank transfer's reference",
            "type": "string",
            "maxLength": 200
          },
          "comment": {
            "description": "A note about the payment",
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": ["kind", "amount"]
      },
      "PaymentsRetainDepositInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project the deposit is held on"
          },
          "amount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000000000,
            "description": "How much of the held deposit to keep, in the smallest currency unit"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "What it's kept for, such as 'Damage to a moving head'. Becomes the charge line's description"
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate the charge is taxed at, with the tax included in the amount kept. Omit for no tax, which is usual for damage",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "date": {
            "description": "When the money was paid, as an ISO 8601 date and time. Omit for now",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "methodUUID": {
            "description": "UUID of how it was paid, from payment-methods.list, usually the deposit's. Omit if not known",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "comment": {
            "description": "A note about the payment",
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": ["projectUUID", "amount", "description"]
      },
      "PaymentsDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the payment to delete. A retained deposit and its payment are deleted together; the charge stays on the project"
          }
        },
        "required": ["uuid"]
      },
      "InvoicesListInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "description": "Only invoices for this project and its sub-projects. Omit for every project",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "clientUUID": {
            "description": "Only invoices for this client's projects and their sub-projects. Sub-clients' projects aren't included",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "kinds": {
            "description": "Only these kinds. Omit for every kind",
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["INVOICE", "DEPOSIT", "CREDIT_NOTE"]
            }
          },
          "status": {
            "description": "Only drafts, or only issued. Omit for both",
            "type": "string",
            "enum": ["DRAFT", "ISSUED"]
          },
          "unpaid": {
            "description": "True for only issued invoices with something still to pay, which aren't credited",
            "type": "boolean"
          },
          "search": {
            "description": "Only invoices whose number or reference contains this text (case-insensitive)",
            "type": "string",
            "maxLength": 255
          },
          "from": {
            "description": "Only invoices issued on or after this date and time",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "to": {
            "description": "Only invoices issued before this date and time",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of invoices per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort invoices by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt", "issuedAt", "number", "dueAt", "gross"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "InvoicesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the invoice"
          }
        },
        "required": ["uuid"]
      },
      "InvoicesCreateDraftInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project or sub-project to invoice. Its sub-projects are included"
          },
          "kind": {
            "default": "INVOICE",
            "description": "INVOICE for everything on the project not yet invoiced, less deposits invoiced. DEPOSIT for a share of the project's total. Defaults to INVOICE",
            "type": "string",
            "enum": ["INVOICE", "DEPOSIT"]
          },
          "depositBp": {
            "description": "For DEPOSIT: the share of the project's total, in basis points (2500 is 25%). Omit for the organisation's default deposit, or give `depositAmount`",
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "depositAmount": {
            "description": "For DEPOSIT: a fixed amount with tax, in the smallest currency unit, instead of a share",
            "type": "integer",
            "minimum": 1,
            "maximum": 10000000000
          },
          "reference": {
            "description": "The client's purchase order or reference",
            "type": "string",
            "maxLength": 200
          },
          "notes": {
            "description": "Printed on the invoice. Omit for the project's invoice notes",
            "type": "string",
            "maxLength": 5000
          }
        },
        "required": ["projectUUID"]
      },
      "InvoicesUpdateDraftInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the draft invoice"
          },
          "reference": {
            "description": "The client's purchase order or reference, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "description": "Printed on the invoice, or null to clear it. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "dueAt": {
            "description": "When it's due, or null to work it out from the payment terms when it's issued. Omit to leave unchanged",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "refresh": {
            "description": "True to build its lines again from the project as it is now, and update who it's made out to",
            "type": "boolean"
          }
        },
        "required": ["uuid"]
      },
      "InvoicesDeleteDraftInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the draft invoice to delete"
          }
        },
        "required": ["uuid"]
      },
      "InvoicesIssueInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the draft invoice to issue"
          },
          "issuedAt": {
            "description": "The invoice date. Omit for now",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": ["uuid"]
      },
      "InvoicesCreditInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the issued invoice to credit"
          },
          "lines": {
            "description": "Credit only these lines, or part of them. Omit to cancel the whole invoice",
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineUUID": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "UUID of a LINE or ADJUSTMENT on the invoice"
                },
                "amount": {
                  "description": "How much of the line to credit before tax, in the smallest currency unit. Tax is worked out at the line's rate. Omit for all that's left of the line",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "required": ["lineUUID"]
            }
          },
          "notes": {
            "description": "Why it's cancelled, printed on the credit note, such as 'Raised in error'",
            "type": "string",
            "maxLength": 5000
          }
        },
        "required": ["uuid"]
      },
      "QuotesListInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "description": "Only quotes for this project and its sub-projects. Omit for every project",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "status": {
            "description": "Only quotes with this status. Omit for all",
            "type": "string",
            "enum": ["ISSUED", "ACCEPTED", "DECLINED"]
          },
          "search": {
            "description": "Only quotes whose number contains this text",
            "type": "string",
            "maxLength": 255
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of quotes per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "issuedAt",
            "description": "Field to sort quotes by. Defaults to `issuedAt`",
            "type": "string",
            "enum": ["issuedAt", "number", "gross"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "QuotesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the quote"
          }
        },
        "required": ["uuid"]
      },
      "QuotesIssueInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project or sub-project to quote for. Its sub-projects are included"
          },
          "validUntil": {
            "description": "When it stops being valid, or null for no expiry. Omit for the organisation's quote validity",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "description": "Printed on the quote. Omit for the project's invoice notes",
            "type": "string",
            "maxLength": 5000
          }
        },
        "required": ["projectUUID"]
      },
      "QuotesDecideInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the quote"
          },
          "decision": {
            "type": "string",
            "enum": ["ACCEPTED", "DECLINED"],
            "description": "ACCEPTED or DECLINED"
          },
          "decidedByName": {
            "description": "Who at the client accepted or declined it, such as 'Megan Price'. Omit if not known",
            "type": "string",
            "maxLength": 200
          },
          "decidedAt": {
            "description": "When they answered. Omit for now",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": ["uuid", "decision"]
      },
      "QuotesShareInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the quote"
          }
        },
        "required": ["uuid"]
      },
      "QuotesRevokeLinkInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the quote"
          }
        },
        "required": ["uuid"]
      },
      "ProjectCrewListInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          }
        },
        "required": ["projectUUID"]
      },
      "ProjectCrewListForMemberInput": {
        "type": "object",
        "properties": {
          "memberUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the member"
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of crew places per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort crew places by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        },
        "required": ["memberUUID"]
      },
      "ProjectCrewAssignInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          },
          "memberUUID": {
            "description": "UUID of the member to add. Give this or personName",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "personName": {
            "description": "Name of someone who isn't a member, such as a freelancer. Give this or memberUUID",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "personEmail": {
            "description": "Email address of someone who isn't a member, so they're included when the crew is emailed. Only with personName",
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "role": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Their role, for example 'Lighting designer'"
          },
          "comment": {
            "description": "A note about them",
            "type": "string",
            "maxLength": 500
          },
          "serviceUUID": {
            "description": "UUID of a service to charge them as, such as 'Lighting technician day'. Adds the service's line to the project, at its rate and cost. Needs permission to change the project's lines",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["projectUUID", "role"]
      },
      "ProjectCrewUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the place on the crew"
          },
          "role": {
            "description": "Their new role",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "comment": {
            "description": "A note about them",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "personEmail": {
            "description": "Email address of someone who isn't a member, or null to remove it. Ignored for a member, whose address comes from their account",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceUUID": {
            "description": "UUID of a service to charge them as, or null to stop charging for them. Replaces the place's line on the project; a line an issued invoice charges for stays, to be credited. Needs permission to change the project's lines",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["uuid"]
      },
      "ProjectCrewRemoveInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the place on the crew"
          }
        },
        "required": ["uuid"]
      },
      "ProjectCrewReorderInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          },
          "crewUUIDs": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Every place on the project's crew, in the new order. Places left out go after these, in their current order"
          }
        },
        "required": ["projectUUID", "crewUUIDs"]
      },
      "ProjectCrewEmailsInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          }
        },
        "required": ["projectUUID"]
      },
      "CrewVacanciesListInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          }
        },
        "required": ["projectUUID"]
      },
      "CrewVacanciesOpenInput": {
        "type": "object",
        "properties": {
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of vacancies per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort vacancies by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt", "name"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "CrewVacanciesGetInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the vacancy"
          }
        },
        "required": ["uuid"]
      },
      "CrewVacanciesCreateInput": {
        "type": "object",
        "properties": {
          "projectUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the project"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "The role, for example 'Stage crew'"
          },
          "crewRoleUUID": {
            "description": "UUID of the crew role it recruits for, whose description it shows alongside its own. Null for none",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "description": "What the role involves, in Markdown",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20000
              },
              {
                "type": "null"
              }
            ]
          },
          "personSpecification": {
            "description": "What you're looking for in an applicant, in Markdown",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20000
              },
              {
                "type": "null"
              }
            ]
          },
          "deadline": {
            "description": "When applications close. Null for no deadline",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "slots": {
            "description": "How many people are needed. Defaults to 1",
            "type": "integer",
            "minimum": 1,
            "maximum": 500
          },
          "open": {
            "description": "Whether it's taking applications. Defaults to true",
            "type": "boolean"
          },
          "showPublic": {
            "description": "List it on the organisation's public site. Ignored while it's limited to roles. Defaults to false",
            "type": "boolean"
          },
          "firstComeFirstServed": {
            "description": "Accept applicants as they apply until every place is filled. Defaults to false",
            "type": "boolean"
          },
          "allowFileUploads": {
            "description": "Let applicants attach files, such as a CV. Defaults to true",
            "type": "boolean"
          },
          "collectPhone": {
            "description": "Ask applicants for a phone number. Defaults to false",
            "type": "boolean"
          },
          "privateToManager": {
            "description": "Only the project's manager and the viewers listed see the applications. Defaults to true",
            "type": "boolean"
          },
          "questions": {
            "description": "Questions applicants answer",
            "maxItems": 30,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyQuestion"
            }
          },
          "roleUUIDs": {
            "description": "Only members of these roles see it. Empty for every member",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "viewerUUIDs": {
            "description": "Members, besides the project's manager, who see the applications",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "certificationTypeUUIDs": {
            "description": "Certifications applicants should hold. Applicants without them are flagged, not refused",
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["projectUUID", "name"]
      },
      "CrewVacanciesUpdateInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the vacancy"
          },
          "name": {
            "description": "The role, for example 'Stage crew'",
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "crewRoleUUID": {
            "description": "UUID of the crew role it recruits for, whose description it shows alongside its own. Null for none",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "description": "What the role involves, in Markdown",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20000
              },
              {
                "type": "null"
              }
            ]
          },
          "personSpecification": {
            "description": "What you're looking for in an applicant, in Markdown",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20000
              },
              {
                "type": "null"
              }
            ]
          },
          "deadline": {
            "description": "When applications close. Null for no deadline",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "slots": {
            "description": "How many people are needed. Defaults to 1",
            "type": "integer",
            "minimum": 1,
            "maximum": 500
          },
          "open": {
            "description": "Whether it's taking applications. Defaults to true",
            "type": "boolean"
          },
          "showPublic": {
            "description": "List it on the organisation's public site. Ignored while it's limited to roles. Defaults to false",
            "type": "boolean"
          },
          "firstComeFirstServed": {
            "description": "Accept applicants as they apply until every place is filled. Defaults to false",
            "type": "boolean"
          },
          "allowFileUploads": {
            "description": "Let applicants attach files, such as a CV. Defaults to true",
            "type": "boolean"
          },
          "collectPhone": {
            "description": "Ask applicants for a phone number. Defaults to false",
            "type": "boolean"
          },
          "privateToManager": {
            "description": "Only the project's manager and the viewers listed see the applications. Defaults to true",
            "type": "boolean"
          },
          "questions": {
            "description": "Questions applicants answer",
            "maxItems": 30,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyQuestion"
            }
          },
          "roleUUIDs": {
            "description": "Only members of these roles see it. Empty for every member",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "viewerUUIDs": {
            "description": "Members, besides the project's manager, who see the applications",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "certificationTypeUUIDs": {
            "description": "Certifications applicants should hold. Applicants without them are flagged, not refused",
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        },
        "required": ["uuid"]
      },
      "CrewVacanciesDeleteInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the vacancy"
          }
        },
        "required": ["uuid"]
      },
      "CrewApplicationsListInput": {
        "type": "object",
        "properties": {
          "vacancyUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the vacancy"
          }
        },
        "required": ["vacancyUUID"]
      },
      "CrewApplicationsMineInput": {
        "type": "object",
        "properties": {
          "vacancyUUID": {
            "description": "Only applications for this vacancy",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "cursor": {
            "description": "`nextCursor` or `previousCursor` from an earlier call, for that page. Omit for the first page. A cursor continues the listing it came from, so `sort` and `direction` are ignored when one is given",
            "type": "string",
            "maxLength": 1024
          },
          "limit": {
            "default": 50,
            "description": "Number of applications per page, at most 100",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "default": "createdAt",
            "description": "Field to sort applications by. Defaults to `createdAt`",
            "type": "string",
            "enum": ["createdAt"]
          },
          "direction": {
            "default": "desc",
            "description": "Sort direction: `asc` or `desc`. Defaults to `desc`",
            "type": "string",
            "enum": ["asc", "desc"]
          }
        }
      },
      "CrewApplicationsApplyInput": {
        "type": "object",
        "properties": {
          "vacancyUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the vacancy"
          },
          "phone": {
            "description": "A phone number. Required when the vacancy asks for one",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "comment": {
            "description": "Why you're applying, or anything else to say",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "answers": {
            "description": "Answers to the vacancy's questions, by question. Answers to questions it doesn't ask are ignored",
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "The question"
                },
                "value": {
                  "type": "string",
                  "maxLength": 10000,
                  "description": "The answer"
                }
              },
              "required": ["name", "value"],
              "description": "An answer to one of the vacancy's questions"
            }
          }
        },
        "required": ["vacancyUUID"]
      },
      "CrewApplicationsWithdrawInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the application"
          }
        },
        "required": ["uuid"]
      },
      "CrewApplicationsAcceptInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the application"
          }
        },
        "required": ["uuid"]
      },
      "CrewApplicationsRejectInput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the application"
          }
        },
        "required": ["uuid"]
      },
      "CrewApplicationsStartFileUploadInput": {
        "type": "object",
        "properties": {
          "applicationUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the caller's own application"
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "The file's name"
          },
          "contentType": {
            "type": "string",
            "enum": [
              "application/pdf",
              "image/jpeg",
              "image/png",
              "image/webp",
              "application/msword",
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
            ],
            "description": "The file's type: a PDF, an image or a Word document"
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 26214400,
            "description": "The file's size in bytes, up to 25 MB"
          }
        },
        "required": ["applicationUUID", "fileName", "contentType", "sizeBytes"]
      },
      "CrewApplicationsFinishFileUploadInput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The token start-file-upload returned"
          }
        },
        "required": ["uploadToken"]
      },
      "CrewApplicationsRemoveFileInput": {
        "type": "object",
        "properties": {
          "fileUUID": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "UUID of the file to remove"
          }
        },
        "required": ["fileUUID"]
      },
      "CrewProjectRef": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the project"
          },
          "number": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The project's number"
          },
          "name": {
            "type": "string",
            "description": "The project's name"
          },
          "ancestors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the project"
                },
                "number": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The project's number"
                },
                "name": {
                  "type": "string",
                  "description": "The project's name"
                }
              },
              "required": ["uuid", "number", "name"],
              "additionalProperties": false,
              "description": "A project above this one"
            },
            "description": "The projects above this one, the top-level project first. Empty for a top-level project"
          },
          "statusName": {
            "type": "string",
            "description": "The project's status"
          },
          "stage": {
            "type": "string",
            "enum": ["ENQUIRY", "PROVISIONAL", "CONFIRMED", "FINISHED", "LOST"],
            "description": "The stage of the project's status"
          },
          "managerUUID": {
            "description": "UUID of the project's manager, or null",
            "type": ["string", "null"]
          },
          "clientName": {
            "description": "The project's client, or null",
            "type": ["string", "null"]
          },
          "start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the crew are needed from: the project's event start, or its out start if it has no event dates. Sub-projects use their parent's dates when they have none"
          },
          "end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the crew are needed until, worked out the same way"
          }
        },
        "required": [
          "uuid",
          "number",
          "name",
          "ancestors",
          "statusName",
          "stage",
          "managerUUID",
          "clientName",
          "start",
          "end"
        ],
        "additionalProperties": false,
        "description": "The project, with the dates its crew work"
      },
      "ProjectCrewMember": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of this place on the crew"
          },
          "project": {
            "$ref": "#/components/schemas/CrewProjectRef"
          },
          "memberUUID": {
            "description": "UUID of the member, or null for a named person",
            "type": ["string", "null"]
          },
          "personName": {
            "description": "Name of someone who isn't a member, or null for a member",
            "type": ["string", "null"]
          },
          "personEmail": {
            "description": "Email address of someone who isn't a member, or null for a member or someone with none",
            "type": ["string", "null"]
          },
          "name": {
            "type": "string",
            "description": "The member's name, or the named person's: whoever this is"
          },
          "role": {
            "type": "string",
            "description": "Their role, such as 'Lighting designer'"
          },
          "comment": {
            "description": "A note about them, or null",
            "type": ["string", "null"]
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position in the crew list"
          },
          "vacancyUUID": {
            "description": "UUID of the vacancy whose accepted application put them here, or null",
            "type": ["string", "null"]
          },
          "service": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the service"
                  },
                  "name": {
                    "type": "string",
                    "description": "The service's name"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The service they're charged as, such as 'Lighting technician day', or null"
          },
          "lineUUID": {
            "description": "UUID of the project line charging for them, or null. Change its quantity or price as any other line",
            "type": ["string", "null"]
          },
          "clashes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "projectUUID": {
                  "type": "string",
                  "description": "UUID of the other project"
                },
                "projectNumber": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The other project's number"
                },
                "projectName": {
                  "type": "string",
                  "description": "The other project's name"
                },
                "role": {
                  "type": "string",
                  "description": "Their role on the other project"
                }
              },
              "required": [
                "projectUUID",
                "projectNumber",
                "projectName",
                "role"
              ],
              "additionalProperties": false,
              "description": "Another project the same member is crewed on whose dates overlap this one's"
            },
            "description": "Other live projects this member is crewed on at the same time. Empty for named people"
          },
          "certifications": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "typeUUID": {
                  "type": "string",
                  "description": "UUID of the certification type"
                },
                "name": {
                  "type": "string",
                  "description": "The certification type's name"
                },
                "result": {
                  "type": "string",
                  "enum": ["VALID", "EXPIRED", "UNVERIFIED", "MISSING"],
                  "description": "Whether the member holds it until the project ends: `VALID`, `EXPIRED` (it runs out first), `UNVERIFIED` or `MISSING`"
                }
              },
              "required": ["typeUUID", "name", "result"],
              "additionalProperties": false
            },
            "description": "Certifications the place needs, from the service they're charged as and the vacancy they filled, and whether the member holds each. Anything but VALID is a warning; it never stops them being crewed. Empty for named people"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When they were added"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When this place last changed"
          }
        },
        "required": [
          "uuid",
          "project",
          "memberUUID",
          "personName",
          "personEmail",
          "name",
          "role",
          "comment",
          "sortOrder",
          "vacancyUUID",
          "service",
          "lineUUID",
          "clashes",
          "certifications",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Someone on a project's crew"
      },
      "VacancyQuestion": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "The question, such as 'Have you used a GrandMA3?'"
          },
          "notes": {
            "default": null,
            "description": "Help shown under the question, or null",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "default": "text",
            "description": "text for a one-line answer, textarea for a longer one",
            "type": "string",
            "enum": ["text", "textarea"]
          },
          "placeholder": {
            "default": null,
            "description": "Example text shown in the empty answer box, or null",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["name", "notes", "type", "placeholder"],
        "additionalProperties": false,
        "description": "A question applicants answer"
      },
      "CrewVacancy": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the vacancy"
          },
          "project": {
            "$ref": "#/components/schemas/CrewProjectRef"
          },
          "name": {
            "type": "string",
            "description": "The role, such as 'Stage crew'. Accepted applicants join the crew with this role"
          },
          "crewRole": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the crew role"
                  },
                  "name": {
                    "type": "string",
                    "description": "The crew role's name"
                  },
                  "description": {
                    "description": "What the crew role involves, with links to more about it, in Markdown",
                    "type": ["string", "null"]
                  }
                },
                "required": ["uuid", "name", "description"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The crew role it recruits for, whose description applies to every vacancy for it. Null for none, or if the crew role was deleted"
          },
          "description": {
            "description": "What the role involves on this project",
            "type": ["string", "null"]
          },
          "personSpecification": {
            "description": "What the organisation is looking for in an applicant",
            "type": ["string", "null"]
          },
          "deadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When applications close, or null for no deadline"
          },
          "slots": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many people are needed"
          },
          "slotsFilled": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many places accepted applications have filled"
          },
          "open": {
            "type": "boolean",
            "description": "Whether it's taking applications"
          },
          "acceptingApplications": {
            "type": "boolean",
            "description": "Whether a member can apply now: it's open, the deadline hasn't passed and places are left"
          },
          "showPublic": {
            "type": "boolean",
            "description": "Whether it's listed on the organisation's public site. A vacancy limited to roles never is"
          },
          "firstComeFirstServed": {
            "type": "boolean",
            "description": "Whether applicants are accepted as they apply, until every place is filled"
          },
          "allowFileUploads": {
            "type": "boolean",
            "description": "Whether applicants can attach files, such as a CV"
          },
          "collectPhone": {
            "type": "boolean",
            "description": "Whether applicants must give a phone number"
          },
          "privateToManager": {
            "type": "boolean",
            "description": "Whether only the project's manager and the listed viewers see the applications"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyQuestion"
            },
            "description": "Questions applicants answer"
          },
          "roleUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the roles whose members see it. Empty means every member"
          },
          "viewerUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of members, besides the project's manager, who see the applications"
          },
          "certificationTypes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the certification type"
                },
                "name": {
                  "type": "string",
                  "description": "The certification type's name"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "Certifications applicants should hold. Applicants without them are flagged, not refused"
          },
          "applicationCount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "How many live applications it has, or null if the caller can't see them"
          },
          "canSeeApplications": {
            "type": "boolean",
            "description": "Whether the caller can see its applications"
          },
          "myApplication": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the caller's application"
                  },
                  "status": {
                    "type": "string",
                    "enum": ["PENDING", "ACCEPTED", "REJECTED", "WITHDRAWN"],
                    "description": "Where it's up to"
                  }
                },
                "required": ["uuid", "status"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The caller's own latest application, or null"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was advertised"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "project",
          "name",
          "crewRole",
          "description",
          "personSpecification",
          "deadline",
          "slots",
          "slotsFilled",
          "open",
          "acceptingApplications",
          "showPublic",
          "firstComeFirstServed",
          "allowFileUploads",
          "collectPhone",
          "privateToManager",
          "questions",
          "roleUUIDs",
          "viewerUUIDs",
          "certificationTypes",
          "applicationCount",
          "canSeeApplications",
          "myApplication",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A role on a project that members can apply for"
      },
      "CrewApplication": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the application"
          },
          "vacancyUUID": {
            "type": "string",
            "description": "UUID of the vacancy"
          },
          "vacancyName": {
            "type": "string",
            "description": "The vacancy's role"
          },
          "project": {
            "$ref": "#/components/schemas/CrewProjectRef"
          },
          "applicantUUID": {
            "type": "string",
            "description": "UUID of the member who applied"
          },
          "applicantName": {
            "type": "string",
            "description": "The applicant's name"
          },
          "phone": {
            "description": "The phone number given, or null",
            "type": ["string", "null"]
          },
          "comment": {
            "description": "What the applicant wrote, or null",
            "type": ["string", "null"]
          },
          "answers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "The question"
                },
                "value": {
                  "type": "string",
                  "maxLength": 10000,
                  "description": "The answer"
                }
              },
              "required": ["name", "value"],
              "additionalProperties": false,
              "description": "An answer to one of the vacancy's questions"
            },
            "description": "Answers to the vacancy's questions"
          },
          "status": {
            "type": "string",
            "enum": ["PENDING", "ACCEPTED", "REJECTED", "WITHDRAWN"],
            "description": "Where it's up to"
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was accepted or rejected, or null"
          },
          "certifications": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "typeUUID": {
                  "type": "string",
                  "description": "UUID of the certification type"
                },
                "name": {
                  "type": "string",
                  "description": "The certification type's name"
                },
                "result": {
                  "type": "string",
                  "enum": ["VALID", "EXPIRED", "UNVERIFIED", "MISSING"],
                  "description": "Whether the applicant holds it"
                }
              },
              "required": ["typeUUID", "name", "result"],
              "additionalProperties": false
            },
            "description": "The vacancy's certifications, and whether the applicant holds each"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the file"
                },
                "name": {
                  "type": "string",
                  "description": "The file's name"
                },
                "sizeBytes": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Size in bytes"
                }
              },
              "required": ["uuid", "name", "sizeBytes"],
              "additionalProperties": false
            },
            "description": "Files attached, such as a CV"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was submitted"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "vacancyUUID",
          "vacancyName",
          "project",
          "applicantUUID",
          "applicantName",
          "phone",
          "comment",
          "answers",
          "status",
          "decidedAt",
          "certifications",
          "files",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "An application for a crew vacancy"
      },
      "ProjectStatus": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the status"
          },
          "name": {
            "type": "string",
            "description": "Display name, for example 'Quote sent'"
          },
          "description": {
            "description": "What the status means, for the people picking it, or null",
            "type": ["string", "null"]
          },
          "stage": {
            "type": "string",
            "enum": ["ENQUIRY", "PROVISIONAL", "CONFIRMED", "FINISHED", "LOST"],
            "description": "What the status does: `ENQUIRY` (no effect on stock), `PROVISIONAL` (on hold, doesn't take stock), `CONFIRMED` (takes stock), `FINISHED` (done, frees stock) or `LOST` (cancelled or lost, frees stock and leaves calendars)"
          },
          "isDefault": {
            "type": "boolean",
            "description": "New projects get this status unless another is given"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position in the list, 0-based"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the status was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the status last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "stage",
          "isDefault",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A project status"
      },
      "ProjectSections": {
        "type": "object",
        "properties": {
          "assets": {
            "type": "boolean",
            "description": "Projects of this type can book assets"
          },
          "crew": {
            "type": "boolean",
            "description": "Projects of this type have crew"
          },
          "finance": {
            "type": "boolean",
            "description": "Projects of this type show prices, invoices and payments"
          },
          "files": {
            "type": "boolean",
            "description": "Projects of this type have files"
          },
          "notes": {
            "type": "boolean",
            "description": "Projects of this type have notes"
          },
          "client": {
            "type": "boolean",
            "description": "Projects of this type have a client"
          },
          "venue": {
            "type": "boolean",
            "description": "Projects of this type have a venue"
          }
        },
        "required": [
          "assets",
          "crew",
          "finance",
          "files",
          "notes",
          "client",
          "venue"
        ],
        "additionalProperties": false,
        "description": "Which sections projects of a type show"
      },
      "ProjectType": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the type"
          },
          "name": {
            "type": "string",
            "description": "Display name, for example 'Dry hire'"
          },
          "sections": {
            "$ref": "#/components/schemas/ProjectSections"
          },
          "isDefault": {
            "type": "boolean",
            "description": "New projects get this type unless another is given"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the type was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the type last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "sections",
          "isDefault",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A project type"
      },
      "ProjectDates": {
        "type": "object",
        "properties": {
          "outStart": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the assets leave. Bookings hold stock from here, or null"
          },
          "outEnd": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the assets are back. Bookings hold stock until here, or null"
          },
          "eventStart": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the event starts, or null"
          },
          "eventEnd": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the event ends, or null"
          },
          "chargeStart": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Start of the period hire is charged for, or null for the out period"
          },
          "chargeEnd": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "End of the period hire is charged for, or null for the out period"
          }
        },
        "required": [
          "outStart",
          "outEnd",
          "eventStart",
          "eventEnd",
          "chargeStart",
          "chargeEnd"
        ],
        "additionalProperties": false,
        "description": "A project's dates"
      },
      "Project": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the project"
          },
          "number": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The project's number in the organisation, for example 1042"
          },
          "name": {
            "type": "string",
            "description": "The project's name"
          },
          "description": {
            "description": "What the project is, in more detail, or null",
            "type": ["string", "null"]
          },
          "status": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "Unique identifier of the status"
              },
              "name": {
                "type": "string",
                "description": "Display name, for example 'Quote sent'"
              },
              "stage": {
                "type": "string",
                "enum": [
                  "ENQUIRY",
                  "PROVISIONAL",
                  "CONFIRMED",
                  "FINISHED",
                  "LOST"
                ],
                "description": "What the status does: `ENQUIRY` (no effect on stock), `PROVISIONAL` (on hold, doesn't take stock), `CONFIRMED` (takes stock), `FINISHED` (done, frees stock) or `LOST` (cancelled or lost, frees stock and leaves calendars)"
              }
            },
            "required": ["uuid", "name", "stage"],
            "additionalProperties": false,
            "description": "Where the project is up to"
          },
          "type": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the type"
              },
              "name": {
                "type": "string",
                "description": "Name of the type"
              },
              "sections": {
                "$ref": "#/components/schemas/ProjectSections"
              }
            },
            "required": ["uuid", "name", "sections"],
            "additionalProperties": false,
            "description": "The project's type, and the sections it turns on"
          },
          "parent": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the project"
                  },
                  "number": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "The project's number"
                  },
                  "name": {
                    "type": "string",
                    "description": "The project's name"
                  }
                },
                "required": ["uuid", "number", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The project this is a sub-project of, or null"
          },
          "ancestors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the project"
                },
                "number": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The project's number"
                },
                "name": {
                  "type": "string",
                  "description": "The project's name"
                }
              },
              "required": ["uuid", "number", "name"],
              "additionalProperties": false
            },
            "description": "The projects above this one, the top-level project first. Empty for a top-level project"
          },
          "subProjects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the project"
                },
                "number": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The project's number"
                },
                "name": {
                  "type": "string",
                  "description": "The project's name"
                },
                "status": {
                  "type": "object",
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "Unique identifier of the status"
                    },
                    "name": {
                      "type": "string",
                      "description": "Display name, for example 'Quote sent'"
                    },
                    "stage": {
                      "type": "string",
                      "enum": [
                        "ENQUIRY",
                        "PROVISIONAL",
                        "CONFIRMED",
                        "FINISHED",
                        "LOST"
                      ],
                      "description": "What the status does: `ENQUIRY` (no effect on stock), `PROVISIONAL` (on hold, doesn't take stock), `CONFIRMED` (takes stock), `FINISHED` (done, frees stock) or `LOST` (cancelled or lost, frees stock and leaves calendars)"
                    }
                  },
                  "required": ["uuid", "name", "stage"],
                  "additionalProperties": false
                },
                "followParentStatus": {
                  "type": "boolean",
                  "description": "Its status follows this project's"
                }
              },
              "required": [
                "uuid",
                "number",
                "name",
                "status",
                "followParentStatus"
              ],
              "additionalProperties": false
            },
            "description": "The project's live sub-projects, in number order"
          },
          "followParentStatus": {
            "type": "boolean",
            "description": "This sub-project's status is kept the same as its parent's. Always false for a top-level project"
          },
          "folder": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the folder"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the folder"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The folder the project is in, or null. Always null for a sub-project, which goes where its parent goes"
          },
          "managerUUID": {
            "description": "UUID of the member managing the project, or null",
            "type": ["string", "null"]
          },
          "client": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the client"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the client"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Who the project is for, or null"
          },
          "clientContact": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the contact"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the contact"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The person at the client the project is with, or null"
          },
          "venue": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the location"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the location"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Where the project happens, or null"
          },
          "dates": {
            "description": "The project's own dates. A sub-project's are null where it uses its parent's",
            "$ref": "#/components/schemas/ProjectDates"
          },
          "effectiveDates": {
            "description": "The dates that apply: the project's own, else its parent's. The charge period falls back to the out period",
            "$ref": "#/components/schemas/ProjectDates"
          },
          "pricing": {
            "type": "object",
            "properties": {
              "clientPricing": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "description": "UUID of the client pricing"
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the client pricing"
                      }
                    },
                    "required": ["uuid", "name"],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The client pricing new lines are priced through, or null for catalogue prices. Starts as the client's"
              },
              "defaultDiscountBp": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The discount new lines get, in basis points: 1000 is 10%"
              },
              "unitsOverride": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Chargeable units for every line, such as 3 days for a week-long hire, instead of working them out from the dates. 0 is free. Null works them out"
              },
              "taxRateOverride": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "description": "UUID of the tax rate"
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the tax rate"
                      }
                    },
                    "required": ["uuid", "name"],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Every line is taxed at this rate instead of its own, or null"
              }
            },
            "required": [
              "clientPricing",
              "defaultDiscountBp",
              "unitsOverride",
              "taxRateOverride"
            ],
            "additionalProperties": false,
            "description": "How the project's lines are priced"
          },
          "invoiceNotes": {
            "description": "Printed on the project's quotes and invoices, or null",
            "type": ["string", "null"]
          },
          "deliveryNotes": {
            "description": "Printed on the project's delivery notes, or null",
            "type": ["string", "null"]
          },
          "followerUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the members following the project. They're emailed when its status changes or it gets a comment"
          },
          "createdByUUID": {
            "description": "UUID of the member who created the project, or null",
            "type": ["string", "null"]
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the project was moved to trash, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the project was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the project last changed"
          }
        },
        "required": [
          "uuid",
          "number",
          "name",
          "description",
          "status",
          "type",
          "parent",
          "ancestors",
          "subProjects",
          "followParentStatus",
          "folder",
          "managerUUID",
          "client",
          "clientContact",
          "venue",
          "dates",
          "effectiveDates",
          "pricing",
          "invoiceNotes",
          "deliveryNotes",
          "followerUUIDs",
          "createdByUUID",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A project"
      },
      "ProjectNote": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the note"
          },
          "projectUUID": {
            "type": "string",
            "description": "UUID of the project it's on"
          },
          "title": {
            "type": "string",
            "description": "The note's title"
          },
          "body": {
            "type": "string",
            "description": "The note, in Markdown"
          },
          "authorUUID": {
            "description": "UUID of the member who wrote it, or null",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the note was written"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the note last changed"
          }
        },
        "required": [
          "uuid",
          "projectUUID",
          "title",
          "body",
          "authorUUID",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A note on a project"
      },
      "ProjectFolder": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the folder"
          },
          "name": {
            "type": "string",
            "description": "The folder's name, for example 'Weddings'"
          },
          "parentUUID": {
            "description": "UUID of the folder it's in, or null for a top-level folder",
            "type": ["string", "null"]
          },
          "projectCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many projects are in the folder itself, not counting those in folders inside it or in trash"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the folder was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the folder last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "parentUUID",
          "projectCount",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A folder that projects are organised in"
      },
      "CalendarWeekLabel": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Any date in the week, such as its Monday: `2027-09-06`. If two dates fall in the same week, the later one wins"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50,
            "description": "What the week is called, such as `Term 1 week 3`"
          }
        },
        "required": ["date", "label"],
        "additionalProperties": false,
        "description": "A name for one week, shown in place of its week number"
      },
      "CalendarSettings": {
        "type": "object",
        "properties": {
          "showStatus": {
            "type": "boolean",
            "description": "Show each project's status after its name"
          },
          "showSubProjects": {
            "type": "boolean",
            "description": "Show sub-projects with dates of their own as entries of their own. Sub-projects using their parent's dates are always left out"
          },
          "defaultView": {
            "type": "string",
            "enum": ["month", "week", "list"],
            "description": "How the calendar opens: `month`, `week`, or `list` for the month's projects as a list"
          },
          "useWeekLabels": {
            "type": "boolean",
            "description": "Show the week labels in place of week numbers"
          },
          "weekLabels": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarWeekLabel"
            },
            "description": "Names for weeks, earliest first"
          }
        },
        "required": [
          "showStatus",
          "showSubProjects",
          "defaultView",
          "useWeekLabels",
          "weekLabels"
        ],
        "additionalProperties": false,
        "description": "How the organisation's calendar looks"
      },
      "CalendarEvent": {
        "type": "object",
        "properties": {
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project"
          },
          "parent": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the parent project"
                  },
                  "number": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "The parent project's number"
                  },
                  "name": {
                    "type": "string",
                    "description": "The parent project's name"
                  }
                },
                "required": ["uuid", "number", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The project this is a sub-project of, or null"
          },
          "status": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the status"
              },
              "name": {
                "type": "string",
                "description": "Name of the status"
              },
              "stage": {
                "type": "string",
                "enum": [
                  "ENQUIRY",
                  "PROVISIONAL",
                  "CONFIRMED",
                  "FINISHED",
                  "LOST"
                ],
                "description": "The status's stage, which the calendar colours it by: `ENQUIRY`, `PROVISIONAL`, `CONFIRMED` or `FINISHED`. Lost projects aren't on calendars"
              }
            },
            "required": ["uuid", "name", "stage"],
            "additionalProperties": false,
            "description": "Where the project is up to"
          },
          "client": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the client"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the client"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Who it's for, or null"
          },
          "venue": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the location"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the location"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Where it happens, or null"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it starts on the calendar: the event start, or the out start if there are no event dates"
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it ends on the calendar: the event end, or the out end if there are no event dates"
          },
          "outStart": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the assets leave, or null"
          },
          "outEnd": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the assets are back, or null"
          },
          "eventStart": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the event starts, or null"
          },
          "eventEnd": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the event ends, or null"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the project last changed"
          }
        },
        "required": [
          "project",
          "parent",
          "status",
          "client",
          "venue",
          "start",
          "end",
          "outStart",
          "outEnd",
          "eventStart",
          "eventEnd",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A project on a calendar, with the dates that apply to it (a sub-project's own, else its parent's)"
      },
      "MyCalendarEvent": {
        "type": "object",
        "properties": {
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project"
          },
          "parent": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the parent project"
                  },
                  "number": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "The parent project's number"
                  },
                  "name": {
                    "type": "string",
                    "description": "The parent project's name"
                  }
                },
                "required": ["uuid", "number", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The project this is a sub-project of, or null"
          },
          "status": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the status"
              },
              "name": {
                "type": "string",
                "description": "Name of the status"
              },
              "stage": {
                "type": "string",
                "enum": [
                  "ENQUIRY",
                  "PROVISIONAL",
                  "CONFIRMED",
                  "FINISHED",
                  "LOST"
                ],
                "description": "The status's stage, which the calendar colours it by: `ENQUIRY`, `PROVISIONAL`, `CONFIRMED` or `FINISHED`. Lost projects aren't on calendars"
              }
            },
            "required": ["uuid", "name", "stage"],
            "additionalProperties": false,
            "description": "Where the project is up to"
          },
          "client": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the client"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the client"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Who it's for, or null"
          },
          "venue": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the location"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the location"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Where it happens, or null"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it starts on the calendar: the event start, or the out start if there are no event dates"
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it ends on the calendar: the event end, or the out end if there are no event dates"
          },
          "outStart": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the assets leave, or null"
          },
          "outEnd": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the assets are back, or null"
          },
          "eventStart": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the event starts, or null"
          },
          "eventEnd": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the event ends, or null"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the project last changed"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["MANAGER", "FOLLOWER", "CREW"]
            },
            "description": "Why it's on the caller's calendar: `MANAGER` (they manage it), `FOLLOWER` (they follow it) or `CREW` (they're on its crew)"
          }
        },
        "required": [
          "project",
          "parent",
          "status",
          "client",
          "venue",
          "start",
          "end",
          "outStart",
          "outEnd",
          "eventStart",
          "eventEnd",
          "updatedAt",
          "reasons"
        ],
        "additionalProperties": false,
        "description": "A project on the caller's own calendar"
      },
      "CalendarFeed": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the feed"
          },
          "scope": {
            "type": "string",
            "enum": ["MINE", "ALL"],
            "description": "`MINE` for the caller's own projects, or `ALL` for every project on the organisation's calendar"
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a calendar app last fetched it, to the hour, or null if none has"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the feed's address was made"
          }
        },
        "required": ["uuid", "scope", "lastUsedAt", "createdAt"],
        "additionalProperties": false,
        "description": "The caller's private calendar feed. Its address is only shown when it's made"
      },
      "Dashboard": {
        "type": "object",
        "properties": {
          "available": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "my-calendar",
                "projects-today",
                "project-shortages",
                "my-maintenance",
                "maintenance-open",
                "inspections-due",
                "inventory-total",
                "inventory-value",
                "members",
                "storage"
              ],
              "description": "A widget: `my-calendar`, `projects-today`, `project-shortages`, `my-maintenance`, `maintenance-open`, `inspections-due`, `inventory-total`, `inventory-value`, `members` or `storage`"
            },
            "description": "The widgets the caller can see, whether shown or hidden, in the order they show"
          },
          "hidden": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "my-calendar",
                "projects-today",
                "project-shortages",
                "my-maintenance",
                "maintenance-open",
                "inspections-due",
                "inventory-total",
                "inventory-value",
                "members",
                "storage"
              ],
              "description": "A widget: `my-calendar`, `projects-today`, `project-shortages`, `my-maintenance`, `maintenance-open`, `inspections-due`, `inventory-total`, `inventory-value`, `members` or `storage`"
            },
            "description": "The widgets the caller has chosen to hide"
          },
          "myCalendar": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "events": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/MyCalendarEvent"
                    },
                    "description": "The caller's projects over the next 14 days"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "The organisation's timezone"
                  }
                },
                "required": ["events", "timezone"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `my-calendar` widget, or null if it isn't shown"
          },
          "projectsToday": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "goingOut": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the project"
                        },
                        "number": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "The project's number"
                        },
                        "name": {
                          "type": "string",
                          "description": "The project's name"
                        },
                        "status": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "The status's name"
                            },
                            "stage": {
                              "type": "string",
                              "enum": [
                                "ENQUIRY",
                                "PROVISIONAL",
                                "CONFIRMED",
                                "FINISHED",
                                "LOST"
                              ],
                              "description": "The status's stage"
                            }
                          },
                          "required": ["name", "stage"],
                          "additionalProperties": false,
                          "description": "The project's status"
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                          "description": "When it goes out, or comes back"
                        }
                      },
                      "required": ["uuid", "number", "name", "status", "at"],
                      "additionalProperties": false
                    },
                    "description": "Projects going out today, earliest first: the first 5"
                  },
                  "goingOutCount": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "How many projects go out today"
                  },
                  "comingBack": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the project"
                        },
                        "number": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "The project's number"
                        },
                        "name": {
                          "type": "string",
                          "description": "The project's name"
                        },
                        "status": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "The status's name"
                            },
                            "stage": {
                              "type": "string",
                              "enum": [
                                "ENQUIRY",
                                "PROVISIONAL",
                                "CONFIRMED",
                                "FINISHED",
                                "LOST"
                              ],
                              "description": "The status's stage"
                            }
                          },
                          "required": ["name", "stage"],
                          "additionalProperties": false,
                          "description": "The project's status"
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                          "description": "When it goes out, or comes back"
                        }
                      },
                      "required": ["uuid", "number", "name", "status", "at"],
                      "additionalProperties": false
                    },
                    "description": "Projects coming back today, earliest first: the first 5"
                  },
                  "comingBackCount": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "How many projects come back today"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "The organisation's timezone"
                  }
                },
                "required": [
                  "goingOut",
                  "goingOutCount",
                  "comingBack",
                  "comingBackCount",
                  "timezone"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `projects-today` widget, or null if it isn't shown. Today is in the organisation's timezone. Sub-projects with their own out dates count on their own; lost projects don't count"
          },
          "projectShortages": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Projects going out in the next 30 days, or out now, that are short of stock"
                  },
                  "projects": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the project"
                        },
                        "number": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "The project's number"
                        },
                        "name": {
                          "type": "string",
                          "description": "The project's name"
                        },
                        "status": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "The status's name"
                            },
                            "stage": {
                              "type": "string",
                              "enum": [
                                "ENQUIRY",
                                "PROVISIONAL",
                                "CONFIRMED",
                                "FINISHED",
                                "LOST"
                              ],
                              "description": "The status's stage"
                            }
                          },
                          "required": ["name", "stage"],
                          "additionalProperties": false,
                          "description": "The project's status"
                        },
                        "outStart": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                          "description": "When it goes out"
                        },
                        "short": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "How many items it's short of, across its lines, after sub-hire"
                        }
                      },
                      "required": [
                        "uuid",
                        "number",
                        "name",
                        "status",
                        "outStart",
                        "short"
                      ],
                      "additionalProperties": false
                    },
                    "description": "The first 5, soonest out first"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "The organisation's timezone"
                  }
                },
                "required": ["count", "projects", "timezone"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `project-shortages` widget, or null if it isn't shown. Only enquiry, provisional and confirmed projects count"
          },
          "myMaintenance": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Open maintenance jobs assigned to or watched by the caller"
                  },
                  "jobs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the job"
                        },
                        "number": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "The job's number"
                        },
                        "title": {
                          "type": "string",
                          "description": "The job's title"
                        },
                        "dueAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "When it's due, or null"
                        }
                      },
                      "required": ["uuid", "number", "title", "dueAt"],
                      "additionalProperties": false
                    },
                    "description": "The first 5, soonest due first"
                  }
                },
                "required": ["count", "jobs"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `my-maintenance` widget, or null if it isn't shown"
          },
          "maintenanceOpen": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Open maintenance jobs"
                  },
                  "overdue": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Open maintenance jobs past their due date"
                  }
                },
                "required": ["count", "overdue"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `maintenance-open` widget, or null if it isn't shown"
          },
          "inspectionsDue": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "overdue": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Inspections of assets that are overdue"
                  },
                  "dueSoon": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Inspections due in the next 14 days that aren't overdue yet"
                  },
                  "inspections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "assetUUID": {
                          "type": "string",
                          "description": "UUID of the asset"
                        },
                        "assetID": {
                          "description": "The asset's primary ID, such as its asset tag",
                          "type": ["string", "null"]
                        },
                        "assetTypeName": {
                          "type": "string",
                          "description": "The asset's type"
                        },
                        "templateName": {
                          "type": "string",
                          "description": "The inspection, such as 'PAT test'"
                        },
                        "dueAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                          "description": "When it's due"
                        },
                        "overdue": {
                          "type": "boolean",
                          "description": "Whether it's overdue"
                        }
                      },
                      "required": [
                        "assetUUID",
                        "assetID",
                        "assetTypeName",
                        "templateName",
                        "dueAt",
                        "overdue"
                      ],
                      "additionalProperties": false
                    },
                    "description": "The first 5, soonest due first"
                  }
                },
                "required": ["overdue", "dueSoon", "inspections"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `inspections-due` widget, or null if it isn't shown"
          },
          "inventoryTotal": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "assets": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Items owned: each asset, and each item in a bulk lot"
                  },
                  "valueSmallestUnit": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Their replacement value, in the smallest unit of the organisation's currency"
                  },
                  "massMg": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Their mass, in milligrams"
                  },
                  "currency": {
                    "type": "string",
                    "description": "The organisation's currency"
                  },
                  "unitSystem": {
                    "type": "string",
                    "enum": ["METRIC", "IMPERIAL_UK", "IMPERIAL_US"],
                    "description": "How the organisation shows masses"
                  }
                },
                "required": [
                  "assets",
                  "valueSmallestUnit",
                  "massMg",
                  "currency",
                  "unitSystem"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `inventory-total` widget, or null if it isn't shown. Archived and deleted assets aren't counted"
          },
          "inventoryValue": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "months": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "month": {
                          "type": "string",
                          "description": "The month, such as `2027-06`"
                        },
                        "valueSmallestUnit": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Replacement value of the assets owned at the end of it, in the smallest currency unit"
                        }
                      },
                      "required": ["month", "valueSmallestUnit"],
                      "additionalProperties": false
                    },
                    "description": "The last 12 months, earliest first"
                  },
                  "currency": {
                    "type": "string",
                    "description": "The organisation's currency"
                  }
                },
                "required": ["months", "currency"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `inventory-value` widget, or null if it isn't shown. An asset counts from when it was added until it was archived"
          },
          "members": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Members of the organisation"
                  }
                },
                "required": ["count"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `members` widget, or null if it isn't shown"
          },
          "storage": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "usedBytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "File storage used, in bytes"
                  },
                  "limitBytes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The plan's file storage, in bytes, or null for no limit"
                  }
                },
                "required": ["usedBytes", "limitBytes"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The `storage` widget, or null if it isn't shown"
          }
        },
        "required": [
          "available",
          "hidden",
          "myCalendar",
          "projectsToday",
          "projectShortages",
          "myMaintenance",
          "maintenanceOpen",
          "inspectionsDue",
          "inventoryTotal",
          "inventoryValue",
          "members",
          "storage"
        ],
        "additionalProperties": false,
        "description": "The caller's dashboard: the widgets they can see, which they've hidden, and what the shown ones hold"
      },
      "CertificationType": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the certification type"
          },
          "name": {
            "type": "string",
            "description": "What it is called, such as 'IPAF 3a'"
          },
          "description": {
            "description": "What it covers, or null",
            "type": ["string", "null"]
          },
          "validityMonths": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "How many months a certification of this type lasts once gained, or null if it never expires"
          },
          "holders": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of members who hold a verified, unrevoked and unexpired certification of this type"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "validityMonths",
          "holders",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Something a member can hold, such as a qualification, licence or card"
      },
      "MemberCertification": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the certification"
          },
          "type": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": ["uuid", "name"],
            "additionalProperties": false,
            "description": "The certification type it is"
          },
          "member": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the member"
              },
              "name": {
                "type": "string",
                "description": "Their full name"
              }
            },
            "required": ["uuid", "name"],
            "additionalProperties": false,
            "description": "Who holds it"
          },
          "gainedOn": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "The day it was gained, YYYY-MM-DD"
          },
          "expiresOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last day it is valid, YYYY-MM-DD, or null if it never expires"
          },
          "issuedBy": {
            "description": "Who issued it, such as 'IPAF' or a training company",
            "type": ["string", "null"]
          },
          "reference": {
            "description": "The card or certificate number",
            "type": ["string", "null"]
          },
          "comment": {
            "description": "Notes, or a sign-off comment",
            "type": ["string", "null"]
          },
          "source": {
            "type": "string",
            "enum": ["MANUAL", "SELF", "TRAINING"],
            "description": "MANUAL: recorded by someone allowed to. SELF: added by the member themselves. TRAINING: awarded by a training module"
          },
          "trainingModule": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The training module that awarded it, for TRAINING"
          },
          "recordedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the member"
                  },
                  "name": {
                    "type": "string",
                    "description": "Their full name"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false,
                "description": "A member of the organisation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who recorded it, or null"
          },
          "verifiedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was verified, or null while unverified"
          },
          "verifiedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the member"
                  },
                  "name": {
                    "type": "string",
                    "description": "Their full name"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false,
                "description": "A member of the organisation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who verified it. Null while unverified, or when AdamRMS awarded it for finishing an online module"
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was revoked, or null"
          },
          "revokedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the member"
                  },
                  "name": {
                    "type": "string",
                    "description": "Their full name"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false,
                "description": "A member of the organisation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who revoked it, or null"
          },
          "revokedReason": {
            "description": "Why it was revoked",
            "type": ["string", "null"]
          },
          "status": {
            "type": "string",
            "enum": ["VALID", "EXPIRING", "EXPIRED", "UNVERIFIED", "REVOKED"],
            "description": "VALID: verified and in date. EXPIRING: verified, but expires within 30 days. EXPIRED: past its expiry date. UNVERIFIED: added by the member and not checked yet. REVOKED: no longer counts"
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the file"
                },
                "name": {
                  "type": "string",
                  "description": "The file's name"
                },
                "mimeType": {
                  "description": "Its type, such as 'image/jpeg'",
                  "type": ["string", "null"]
                },
                "sizeBytes": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Its size in bytes"
                }
              },
              "required": ["uuid", "name", "mimeType", "sizeBytes"],
              "additionalProperties": false,
              "description": "A photo or PDF of the card or certificate"
            },
            "description": "Photos or PDFs of the card or certificate"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was recorded"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "type",
          "member",
          "gainedOn",
          "expiresOn",
          "issuedBy",
          "reference",
          "comment",
          "source",
          "trainingModule",
          "recordedBy",
          "verifiedAt",
          "verifiedBy",
          "revokedAt",
          "revokedBy",
          "revokedReason",
          "status",
          "evidence",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A certification a member holds"
      },
      "TrainingModule": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the module"
          },
          "name": {
            "type": "string",
            "description": "What it is called"
          },
          "description": {
            "description": "What it is about, or null",
            "type": ["string", "null"]
          },
          "learningObjectives": {
            "description": "What members will be able to do once they finish, in Markdown",
            "type": ["string", "null"]
          },
          "icon": {
            "description": "Icon reference: `tabler:<name>` or `custom:<uuid>`",
            "type": ["string", "null"]
          },
          "type": {
            "type": "string",
            "enum": ["ONLINE", "HYBRID", "IN_PERSON"],
            "description": "ONLINE: members work through the steps, and finishing them awards the certification. HYBRID: members work through the steps, then someone signs them off. IN_PERSON: there are no steps to finish; someone signs members off after training them"
          },
          "published": {
            "type": "boolean",
            "description": "Whether members can see it. Drafts are only seen by editors"
          },
          "certificationType": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "validityMonths": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": ["uuid", "name", "validityMonths"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The certification it awards, or null"
          },
          "visibleToRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "Roles that may see it. Empty for every member"
          },
          "stepCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of published steps"
          },
          "estimatedMinutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total estimated minutes of its published steps"
          },
          "author": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false,
                "description": "A member of the organisation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who created it, or null"
          },
          "myProgress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "startedAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "updatedAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "completedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "completedSteps": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Published steps the caller has done"
                  }
                },
                "required": [
                  "startedAt",
                  "updatedAt",
                  "completedAt",
                  "completedSteps"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "How far the caller has got, or null if they haven't started"
          },
          "myCertification": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "VALID",
                      "EXPIRING",
                      "EXPIRED",
                      "UNVERIFIED",
                      "REVOKED"
                    ]
                  },
                  "expiresOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": ["uuid", "status", "expiresOn"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The caller's best certification of the type this module awards, or null"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "learningObjectives",
          "icon",
          "type",
          "published",
          "certificationType",
          "visibleToRoles",
          "stepCount",
          "estimatedMinutes",
          "author",
          "myProgress",
          "myCertification",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A training module"
      },
      "TrainingStep": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the step"
          },
          "name": {
            "type": "string",
            "description": "The step's title"
          },
          "type": {
            "type": "string",
            "enum": ["TEXT", "VIDEO"],
            "description": "TEXT or VIDEO"
          },
          "content": {
            "type": "string",
            "description": "Markdown: the step's text, or for a video what shows under it. Images are `![name](file:<uuid>)`, files of the module"
          },
          "videoId": {
            "description": "The YouTube video's ID, for a VIDEO step",
            "type": ["string", "null"]
          },
          "estimatedMinutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Roughly how long it takes"
          },
          "internalNotes": {
            "description": "Notes only editors see. Null for everyone else",
            "type": ["string", "null"]
          },
          "published": {
            "type": "boolean",
            "description": "Whether members see it. Unpublished steps are only seen by editors"
          },
          "completed": {
            "type": "boolean",
            "description": "Whether the caller has done it"
          }
        },
        "required": [
          "uuid",
          "name",
          "type",
          "content",
          "videoId",
          "estimatedMinutes",
          "internalNotes",
          "published",
          "completed"
        ],
        "additionalProperties": false,
        "description": "One step of a training module"
      },
      "DocumentTemplateSettings": {
        "type": "object",
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "description": "The title printed on the document, such as 'Tax invoice'. Null uses the kind's own title"
          },
          "introText": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ],
            "description": "Text printed under the title, or null for none"
          },
          "footerText": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ],
            "description": "Text printed at the end, such as terms or payment details, or null for none"
          },
          "accentColour": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "description": "Colour for headings and lines, as #rrggbb"
          },
          "font": {
            "type": "string",
            "enum": ["SANS", "SERIF", "MONO"],
            "description": "Font: `SANS` (Arial), `SERIF` (Georgia) or `MONO` (Courier New)"
          },
          "showLogo": {
            "type": "boolean",
            "description": "Print the organisation's logo at the top"
          }
        },
        "required": [
          "title",
          "introText",
          "footerText",
          "accentColour",
          "font",
          "showLogo"
        ],
        "additionalProperties": false,
        "description": "Settings that adjust a template's layout. Custom HTML can read them as `settings`"
      },
      "DocumentTemplate": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the template"
          },
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "name": {
            "type": "string",
            "description": "Display name, such as 'PAT certificate'"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Used for this kind when a document is made without naming a template"
          },
          "paperSize": {
            "type": "string",
            "enum": ["A4", "LETTER"],
            "description": "Paper size: `A4` (210 × 297 mm) or `LETTER` (8.5 × 11 in)"
          },
          "settings": {
            "$ref": "#/components/schemas/DocumentTemplateSettings"
          },
          "html": {
            "description": "The template's own Liquid HTML, or null if it uses the kind's built-in layout",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the template was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the template last changed"
          }
        },
        "required": [
          "uuid",
          "kind",
          "name",
          "isDefault",
          "paperSize",
          "settings",
          "html",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "How one kind of document looks. A kind with no templates uses its built-in layout"
      },
      "GeneratedDocument": {
        "type": "object",
        "properties": {
          "fileUUID": {
            "type": "string",
            "description": "UUID of the PDF, an ordinary file in the organisation's files"
          },
          "filename": {
            "type": "string",
            "description": "The file's name, such as 'PAT certificate A0042.pdf'"
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Size of the PDF in bytes"
          },
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "templateUUID": {
            "description": "UUID of the template used, or null for the built-in layout",
            "type": ["string", "null"]
          },
          "recordUUID": {
            "type": "string",
            "description": "UUID of what the document is about"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the document was made"
          }
        },
        "required": [
          "fileUUID",
          "filename",
          "sizeBytes",
          "kind",
          "templateUUID",
          "recordUUID",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "A PDF document AdamRMS made from a template"
      },
      "ProjectDocument": {
        "type": "object",
        "properties": {
          "fileUUID": {
            "type": "string",
            "description": "UUID of the PDF, an ordinary file in the organisation's files"
          },
          "filename": {
            "type": "string",
            "description": "The file's name, such as 'PAT certificate A0042.pdf'"
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Size of the PDF in bytes"
          },
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "templateUUID": {
            "description": "UUID of the template used, or null for the built-in layout",
            "type": ["string", "null"]
          },
          "recordUUID": {
            "type": "string",
            "description": "UUID of what the document is about"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the document was made"
          },
          "projectUUID": {
            "type": "string",
            "description": "UUID of the project or sub-project the document is kept on"
          },
          "madeByUUID": {
            "description": "UUID of the member who made it, or null",
            "type": ["string", "null"]
          },
          "lastEmailedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was last emailed to the client with documents.email, or null if it never was"
          }
        },
        "required": [
          "fileUUID",
          "filename",
          "sizeBytes",
          "kind",
          "templateUUID",
          "recordUUID",
          "createdAt",
          "projectUUID",
          "madeByUUID",
          "lastEmailedAt"
        ],
        "additionalProperties": false,
        "description": "A PDF document kept on a project"
      },
      "DocumentBatch": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the batch"
          },
          "kind": {
            "type": "string",
            "enum": [
              "INSPECTION_CERTIFICATE",
              "INVOICE",
              "QUOTE",
              "DELIVERY_NOTE",
              "PICKING_LIST",
              "RETURN_NOTE",
              "CREW_CALL_SHEET",
              "PROJECT_NOTES",
              "CLIENT_STATEMENT"
            ],
            "description": "What the document is: `INSPECTION_CERTIFICATE` (a certificate for one inspection result, such as a PAT test or LOLER examination. Made for the result's UUID), `INVOICE` (an invoice, deposit invoice or credit note, with its lines and tax by rate. Made for the invoice's UUID (from invoices.list). An issued invoice's PDF is kept and can't be deleted), `QUOTE` (a quote, with its lines and totals as they were when it was issued. Made for the quote's UUID (from quotes.list)), `DELIVERY_NOTE` (a delivery note: what goes out on a project, with the asset IDs allocated, the project's delivery notes and space for a signature, without prices. Made for the project's UUID), `PICKING_LIST` (a picking list: what goes out on a project, with a tick box for each line and asset ID, for prepping it in the warehouse. Made for the project's UUID), `RETURN_NOTE` (a return note: what went out on a project and what has come back so far, with a tick box for each asset ID still out and space for signatures, without prices. Made for the project's UUID), `CREW_CALL_SHEET` (a crew call sheet: the project's dates and venue, and each crew member's role, name and notes. Made for the project's UUID), `PROJECT_NOTES` (the project's notes, oldest first, with the project's details. Made for the project's UUID), `CLIENT_STATEMENT` (a client's statement: their invoices, credit notes and payments with a running balance, and what's still to pay on each unpaid invoice. Made for the client's UUID, and kept with the client's files)"
          },
          "templateUUID": {
            "description": "UUID of the template used, or null for the kind's default",
            "type": ["string", "null"]
          },
          "status": {
            "type": "string",
            "enum": ["RUNNING", "FINISHED"],
            "description": "RUNNING while documents are still being made, FINISHED once every record has a document or a failure"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many documents the batch makes"
          },
          "made": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many have been made so far"
          },
          "failed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many couldn't be made"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "recordUUID": {
                  "type": "string",
                  "description": "UUID of what it's about"
                },
                "document": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GeneratedDocument"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The document, once it's made, or null"
                },
                "errorCode": {
                  "description": "Why it couldn't be made, such as RECORD_NOT_FOUND or PERMISSION_DENIED, or null",
                  "type": ["string", "null"]
                }
              },
              "required": ["recordUUID", "document", "errorCode"],
              "additionalProperties": false
            },
            "description": "Each record, in the order asked for"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the batch was started"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it finished, or null while it's running"
          }
        },
        "required": [
          "uuid",
          "kind",
          "templateUUID",
          "status",
          "total",
          "made",
          "failed",
          "items",
          "createdAt",
          "finishedAt"
        ],
        "additionalProperties": false,
        "description": "Documents being made in the background, one for each record. Each is kept on its record as documents.create keeps it. Batches are kept for 30 days"
      },
      "DocumentSettings": {
        "type": "object",
        "properties": {
          "showAdamRMSFooter": {
            "type": "boolean",
            "description": "Whether every document has a line at the foot of each page saying it was made with AdamRMS"
          }
        },
        "required": ["showAdamRMSFooter"],
        "additionalProperties": false,
        "description": "Settings for every document the organisation makes"
      },
      "WikiCard": {
        "type": "object",
        "properties": {
          "title": {
            "default": null,
            "description": "Heading shown at the top of the card, or null for none",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "colour": {
            "default": "DEFAULT",
            "description": "The card's colour. `DEFAULT` is the page's own background colour",
            "type": "string",
            "enum": [
              "DEFAULT",
              "BLUE",
              "CYAN",
              "TEAL",
              "GREEN",
              "LIME",
              "YELLOW",
              "ORANGE",
              "RED",
              "PINK",
              "GRAPE",
              "VIOLET",
              "INDIGO",
              "GRAY",
              "DARK"
            ]
          },
          "style": {
            "default": "OUTLINE",
            "description": "`OUTLINE` draws a coloured border around the card. `FILLED` fills the card with a light shade of its colour",
            "type": "string",
            "enum": ["OUTLINE", "FILLED"]
          },
          "width": {
            "default": "FULL",
            "description": "How much of the page's width the card takes on a wide screen. Cards sit side by side until a row is full. Phones show every card full width",
            "type": "string",
            "enum": [
              "FULL",
              "THREE_QUARTERS",
              "TWO_THIRDS",
              "HALF",
              "THIRD",
              "QUARTER"
            ]
          },
          "content": {
            "default": "",
            "description": "The card's text, in Markdown (GitHub flavoured: headings, lists, tables, links). Show an image attached to the page with `![description](file:<file uuid>)`. HTML is shown as plain text",
            "type": "string",
            "maxLength": 100000
          }
        },
        "required": ["title", "colour", "style", "width", "content"],
        "additionalProperties": false,
        "description": "One box of content on a wiki page"
      },
      "WikiPage": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the page"
          },
          "name": {
            "type": "string",
            "description": "The page's title, such as 'Loading the van'"
          },
          "description": {
            "description": "A sentence about what the page is for, or null",
            "type": ["string", "null"]
          },
          "icon": {
            "description": "The page's icon: `tabler:<name>` for an icon from the Tabler library (https://tabler.io/icons, e.g. `tabler:book`), or `custom:<uuid>` for one the organisation uploaded. Null for none",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the page this is a sub-page of, or null for a top-level page",
            "type": ["string", "null"]
          },
          "parentName": {
            "description": "Name of the parent page, or null for a top-level page",
            "type": ["string", "null"]
          },
          "showInMenu": {
            "type": "boolean",
            "description": "True if the page is listed in the side menu, for the members who can see it"
          },
          "showSubPages": {
            "type": "boolean",
            "description": "True if the page lists its sub-pages, under its cards"
          },
          "showFiles": {
            "type": "boolean",
            "description": "True if the page lists its files, under its cards"
          },
          "menuOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Where the page comes in the side menu and among its sibling pages: lowest first"
          },
          "visibleToRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the role"
                },
                "name": {
                  "type": "string",
                  "description": "The role's name"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false,
              "description": "A role"
            },
            "description": "The roles whose members can see the page. Empty means every member can. Members who can edit pages see every page"
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of the newest revision: the one the page shows"
          },
          "subPageCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many live sub-pages it has that the caller can see"
          },
          "archived": {
            "type": "boolean",
            "description": "True if the page is archived: kept, but left out of the menu and the list of pages"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the page was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the page or its content last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "icon",
          "parentUUID",
          "parentName",
          "showInMenu",
          "showSubPages",
          "showFiles",
          "menuOrder",
          "visibleToRoles",
          "revision",
          "subPageCount",
          "archived",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A page in the organisation's wiki, such as a warehouse procedure. Its content is its newest revision"
      },
      "WikiRevisionSummary": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Revision number, counting up from 1"
          },
          "changelog": {
            "description": "The editor's note about what changed, or null",
            "type": ["string", "null"]
          },
          "authorUUID": {
            "description": "UUID of the member who saved it, or null if not known",
            "type": ["string", "null"]
          },
          "authorName": {
            "description": "Name of the member who saved it, or null if not known",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was saved"
          }
        },
        "required": [
          "revision",
          "changelog",
          "authorUUID",
          "authorName",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "One saved version of a page, without its content"
      },
      "WikiPageWithContent": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the page"
          },
          "name": {
            "type": "string",
            "description": "The page's title, such as 'Loading the van'"
          },
          "description": {
            "description": "A sentence about what the page is for, or null",
            "type": ["string", "null"]
          },
          "icon": {
            "description": "The page's icon: `tabler:<name>` for an icon from the Tabler library (https://tabler.io/icons, e.g. `tabler:book`), or `custom:<uuid>` for one the organisation uploaded. Null for none",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the page this is a sub-page of, or null for a top-level page",
            "type": ["string", "null"]
          },
          "parentName": {
            "description": "Name of the parent page, or null for a top-level page",
            "type": ["string", "null"]
          },
          "showInMenu": {
            "type": "boolean",
            "description": "True if the page is listed in the side menu, for the members who can see it"
          },
          "showSubPages": {
            "type": "boolean",
            "description": "True if the page lists its sub-pages, under its cards"
          },
          "showFiles": {
            "type": "boolean",
            "description": "True if the page lists its files, under its cards"
          },
          "menuOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Where the page comes in the side menu and among its sibling pages: lowest first"
          },
          "visibleToRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the role"
                },
                "name": {
                  "type": "string",
                  "description": "The role's name"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false,
              "description": "A role"
            },
            "description": "The roles whose members can see the page. Empty means every member can. Members who can edit pages see every page"
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of the newest revision: the one the page shows"
          },
          "subPageCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many live sub-pages it has that the caller can see"
          },
          "archived": {
            "type": "boolean",
            "description": "True if the page is archived: kept, but left out of the menu and the list of pages"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the page was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the page or its content last changed"
          },
          "content": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Revision number, counting up from 1"
                  },
                  "changelog": {
                    "description": "The editor's note about what changed, or null",
                    "type": ["string", "null"]
                  },
                  "authorUUID": {
                    "description": "UUID of the member who saved it, or null if not known",
                    "type": ["string", "null"]
                  },
                  "authorName": {
                    "description": "Name of the member who saved it, or null if not known",
                    "type": ["string", "null"]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                    "description": "When it was saved"
                  },
                  "cards": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/WikiCard"
                    },
                    "description": "The page's cards, in order"
                  }
                },
                "required": [
                  "revision",
                  "changelog",
                  "authorUUID",
                  "authorName",
                  "createdAt",
                  "cards"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The revision asked for (the newest by default) with its cards, or null if the page has never been saved"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "icon",
          "parentUUID",
          "parentName",
          "showInMenu",
          "showSubPages",
          "showFiles",
          "menuOrder",
          "visibleToRoles",
          "revision",
          "subPageCount",
          "archived",
          "createdAt",
          "updatedAt",
          "content"
        ],
        "additionalProperties": false,
        "description": "A wiki page with the content of one of its revisions"
      },
      "AssetImportRow": {
        "type": "object",
        "properties": {
          "assetID": {
            "description": "The asset ID. An asset with this ID is skipped or updated (see `existingAssets`). Blank takes the next ID from the organisation's sequence",
            "type": "string",
            "maxLength": 20000
          },
          "assetType": {
            "description": "Name of the asset type (required), matched ignoring case. Created if missing and `createAssetTypes` is on",
            "type": "string",
            "maxLength": 20000
          },
          "category": {
            "description": "The category, for a new asset type: its name, or a path such as `Lighting > Moving heads` when the name is used twice. Created if missing and `createCategories` is on",
            "type": "string",
            "maxLength": 20000
          },
          "manufacturer": {
            "description": "Name of the manufacturer, for a new asset type. Created if missing and `createManufacturers` is on",
            "type": "string",
            "maxLength": 20000
          },
          "tracking": {
            "description": "For a new asset type: `Individual` (the default) or `Bulk`",
            "type": "string",
            "maxLength": 20000
          },
          "description": {
            "description": "For a new asset type: its description",
            "type": "string",
            "maxLength": 20000
          },
          "productLink": {
            "description": "For a new asset type: link to the product page",
            "type": "string",
            "maxLength": 20000
          },
          "typeRate": {
            "description": "For a new asset type: its hire rate, in the organisation's currency's main unit (`12.50` for £12.50)",
            "type": "string",
            "maxLength": 20000
          },
          "typeValue": {
            "description": "For a new asset type: its replacement value, in the main currency unit",
            "type": "string",
            "maxLength": 20000
          },
          "typeMass": {
            "description": "For a new asset type: the mass of one unit, in `massUnit`",
            "type": "string",
            "maxLength": 20000
          },
          "quantity": {
            "description": "Bulk asset types only: how many items the lot holds. Defaults to 1",
            "type": "string",
            "maxLength": 20000
          },
          "location": {
            "description": "Where the asset is kept: a location's name, a path such as `Warehouse > Bay 3`, or its UUID. Created if missing and `createLocations` is on",
            "type": "string",
            "maxLength": 20000
          },
          "rate": {
            "description": "The asset's own hire rate, overriding its type's, in the main currency unit. Blank uses the type's",
            "type": "string",
            "maxLength": 20000
          },
          "value": {
            "description": "The asset's own replacement value, in the main currency unit. Blank uses the type's",
            "type": "string",
            "maxLength": 20000
          },
          "mass": {
            "description": "The asset's own mass, in `massUnit`. Blank uses the type's",
            "type": "string",
            "maxLength": 20000
          },
          "customFields": {
            "description": "Custom field values by field UUID, as text: numbers, `yes`/`no`, dates (`2026-12-25` or `25/12/2026`) and SELECT options by name. Fields set on the asset type are only used for a new type",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 20000
            }
          }
        },
        "additionalProperties": false,
        "description": "One spreadsheet row, as text cells"
      },
      "AssetImportIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "The column: a row field such as `category`, `customFields.<uuid>`, or empty for the whole row"
          },
          "code": {
            "type": "string",
            "enum": [
              "ASSET_TYPE_REQUIRED",
              "ASSET_TYPE_NOT_FOUND",
              "ASSET_TYPE_AMBIGUOUS",
              "CATEGORY_REQUIRED",
              "CATEGORY_NOT_FOUND",
              "CATEGORY_AMBIGUOUS",
              "CATEGORY_HAS_SUBCATEGORIES",
              "CATEGORY_TOO_DEEP",
              "MANUFACTURER_NOT_FOUND",
              "LOCATION_NOT_FOUND",
              "LOCATION_AMBIGUOUS",
              "NOT_A_NUMBER",
              "NEGATIVE",
              "TOO_LARGE",
              "NOT_WHOLE",
              "TOO_LONG",
              "INVALID_LINK",
              "INVALID_TRACKING",
              "QUANTITY_NOT_ALLOWED",
              "DUPLICATE_ID",
              "OTHER_TYPE",
              "CANT_CREATE",
              "CANT_UPDATE",
              "FIELD_UNKNOWN",
              "FIELD_NOT_ON_TYPE",
              "FIELD_REQUIRED",
              "FIELD_WRONG_VALUE",
              "FIELD_NOT_AN_OPTION",
              "FIELD_TOO_LONG",
              "FIELD_OUT_OF_RANGE",
              "FIELD_NOT_IMPORTABLE",
              "FAILED"
            ],
            "description": "What is wrong"
          },
          "message": {
            "type": "string",
            "description": "What is wrong, in words"
          },
          "value": {
            "description": "The cell's text or the name involved",
            "type": ["string", "null"]
          },
          "name": {
            "description": "The custom field's name, or what can't be created",
            "type": ["string", "null"]
          },
          "limit": {
            "description": "The limit or row number the message refers to",
            "type": ["number", "null"]
          },
          "detail": {
            "description": "FAILED: why the function that writes the row refused it",
            "type": ["string", "null"]
          }
        },
        "required": [
          "field",
          "code",
          "message",
          "value",
          "name",
          "limit",
          "detail"
        ],
        "additionalProperties": false
      },
      "AppUiNode": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "stack"
              },
              "gap": {
                "description": "Space between children",
                "type": "string",
                "enum": ["xs", "sm", "md", "lg"]
              },
              "children": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AppUiNode"
                },
                "description": "Components, in order"
              }
            },
            "required": ["type", "children"],
            "additionalProperties": false,
            "description": "Components one above another"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "group"
              },
              "gap": {
                "description": "Space between children",
                "type": "string",
                "enum": ["xs", "sm", "md", "lg"]
              },
              "children": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AppUiNode"
                },
                "description": "Components, in order"
              }
            },
            "required": ["type", "children"],
            "additionalProperties": false,
            "description": "Components side by side, wrapping"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "title"
              },
              "text": {
                "type": "string",
                "maxLength": 2000,
                "description": "The heading"
              },
              "order": {
                "description": "Heading level, 3 (largest) to 6. Defaults to 5",
                "anyOf": [
                  {
                    "type": "number",
                    "const": 3
                  },
                  {
                    "type": "number",
                    "const": 4
                  },
                  {
                    "type": "number",
                    "const": 5
                  },
                  {
                    "type": "number",
                    "const": 6
                  }
                ]
              }
            },
            "required": ["type", "text"],
            "additionalProperties": false,
            "description": "A heading"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "text"
              },
              "text": {
                "type": "string",
                "maxLength": 2000,
                "description": "The text. Line breaks are kept"
              },
              "size": {
                "description": "Size",
                "type": "string",
                "enum": ["xs", "sm", "md"]
              },
              "color": {
                "type": "string",
                "enum": [
                  "gray",
                  "red",
                  "orange",
                  "yellow",
                  "green",
                  "blue",
                  "violet"
                ],
                "description": "Colour"
              },
              "bold": {
                "description": "Whether it is bold",
                "type": "boolean"
              }
            },
            "required": ["type", "text"],
            "additionalProperties": false,
            "description": "A paragraph of text"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "badge"
              },
              "text": {
                "type": "string",
                "maxLength": 2000,
                "description": "The badge's text"
              },
              "color": {
                "type": "string",
                "enum": [
                  "gray",
                  "red",
                  "orange",
                  "yellow",
                  "green",
                  "blue",
                  "violet"
                ],
                "description": "Colour"
              }
            },
            "required": ["type", "text"],
            "additionalProperties": false,
            "description": "A small coloured label"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "alert"
              },
              "title": {
                "type": "string",
                "maxLength": 2000,
                "description": "Heading of the alert"
              },
              "text": {
                "type": "string",
                "maxLength": 2000,
                "description": "The message"
              },
              "color": {
                "type": "string",
                "enum": [
                  "gray",
                  "red",
                  "orange",
                  "yellow",
                  "green",
                  "blue",
                  "violet"
                ],
                "description": "Colour"
              }
            },
            "required": ["type", "text"],
            "additionalProperties": false,
            "description": "A highlighted message"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "keyValue"
              },
              "items": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "maxLength": 2000,
                      "description": "Label"
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 2000,
                      "description": "Value"
                    }
                  },
                  "required": ["label", "value"],
                  "additionalProperties": false
                },
                "description": "Rows of label and value"
              }
            },
            "required": ["type", "items"],
            "additionalProperties": false,
            "description": "A list of labelled values, like a record's details"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "table"
              },
              "columns": {
                "minItems": 1,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 2000,
                  "description": "Column heading"
                },
                "description": "Column headings"
              },
              "rows": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "maxItems": 10,
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "description": "Rows of cells, in column order"
              }
            },
            "required": ["type", "columns", "rows"],
            "additionalProperties": false,
            "description": "A table"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "link"
              },
              "text": {
                "type": "string",
                "maxLength": 2000,
                "description": "The link's text"
              },
              "href": {
                "type": "string",
                "maxLength": 2000,
                "description": "Where it goes: an `https://` URL (opened in a new tab), or a path in AdamRMS such as `/en/org/my-org/assets`"
              }
            },
            "required": ["type", "text", "href"],
            "additionalProperties": false,
            "description": "A link"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "divider"
              }
            },
            "required": ["type"],
            "additionalProperties": false,
            "description": "A horizontal line"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "button"
              },
              "label": {
                "type": "string",
                "maxLength": 2000,
                "description": "The button's text"
              },
              "action": {
                "description": "The handler it runs, one of the extension's `actions`. Give this or `function`",
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "function": {
                "description": "One of the App's own functions (from `provides`), by name, called with `input` as the function's input. It is called as the member pressing it, who needs the function's permission. Give this or `action`",
                "type": "string",
                "minLength": 1,
                "maxLength": 50
              },
              "input": {
                "description": "Any JSON, given to the action as `event.input`. It comes back from the browser, so the action must check it as it would any input"
              },
              "variant": {
                "description": "Style. Defaults to `light`",
                "type": "string",
                "enum": ["filled", "light", "default"]
              },
              "color": {
                "type": "string",
                "enum": [
                  "gray",
                  "red",
                  "orange",
                  "yellow",
                  "green",
                  "blue",
                  "violet"
                ],
                "description": "Colour"
              },
              "confirm": {
                "type": "string",
                "maxLength": 2000,
                "description": "If given, the member is asked this and must confirm before it runs"
              }
            },
            "required": ["type", "label"],
            "additionalProperties": false,
            "description": "A button that runs one of the App's actions or calls one of its functions"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "form"
              },
              "action": {
                "description": "The handler it runs, one of the extension's `actions`, with the values as `event.values`. Give this or `function`",
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "function": {
                "description": "One of the App's own functions (from `provides`), by name, called with the values as its input, as the member sending it, who needs the function's permission. Give this or `action`",
                "type": "string",
                "minLength": 1,
                "maxLength": 50
              },
              "fields": {
                "minItems": 1,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,63}$",
                      "description": "Key of the value in `event.values`"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 2000,
                      "description": "Label shown beside the field"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "text",
                        "textarea",
                        "number",
                        "checkbox",
                        "select"
                      ],
                      "description": "Kind of input"
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 2000,
                      "description": "Help shown under the field"
                    },
                    "required": {
                      "description": "Whether the form cannot be sent without it",
                      "type": "boolean"
                    },
                    "defaultValue": {
                      "description": "Starting value",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        }
                      ]
                    },
                    "options": {
                      "description": "For `select`: the choices",
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "maxLength": 200,
                            "description": "Value sent"
                          },
                          "label": {
                            "type": "string",
                            "maxLength": 2000,
                            "description": "Label shown"
                          }
                        },
                        "required": ["value", "label"],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": ["name", "label", "type"],
                  "additionalProperties": false,
                  "description": "One input of a form"
                },
                "description": "Its inputs"
              },
              "submitLabel": {
                "type": "string",
                "maxLength": 2000,
                "description": "The submit button's text"
              }
            },
            "required": ["type", "fields", "submitLabel"],
            "additionalProperties": false,
            "description": "A form that runs one of the App's actions or calls one of its functions"
          }
        ]
      },
      "AppManifest": {
        "type": "object",
        "properties": {
          "permissions": {
            "default": [],
            "description": "Permissions the App's bot member holds once installed. Each function the App calls needs its permission here",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "AUDIT_LOGS.VIEW",
                "AI_USAGE.VIEW",
                "ORGANISATIONS_USERS.VIEW",
                "ORGANISATIONS_USERS.CREATE",
                "ORGANISATIONS_USERS.UPDATE",
                "ORGANISATIONS_USERS.DELETE",
                "ORGANISATIONS_USERS.VIEW_DELETED",
                "ORGANISATIONS_USERS.RESTORE",
                "ORGANISATIONS_USERS.SEND",
                "ORGANISATIONS_PERMISSIONS.VIEW",
                "ORGANISATIONS_PERMISSIONS.CREATE",
                "ORGANISATIONS_PERMISSIONS.UPDATE",
                "ORGANISATIONS_PERMISSIONS.DELETE",
                "ORGANISATIONS_PERMISSIONS.VIEW_DELETED",
                "ORGANISATIONS_PERMISSIONS.RESTORE",
                "ORGANISATIONS_LICENCES.VIEW",
                "ORGANISATIONS_LICENCES.UPDATE",
                "ORGANISATIONS_JOIN_METHODS.VIEW",
                "ORGANISATIONS_JOIN_METHODS.CREATE",
                "ORGANISATIONS_JOIN_METHODS.UPDATE",
                "ORGANISATIONS_JOIN_METHODS.DELETE",
                "WEBHOOKS.VIEW",
                "WEBHOOKS.CREATE",
                "WEBHOOKS.UPDATE",
                "WEBHOOKS.DELETE",
                "ORGANISATIONS_SUBSCRIPTION.VIEW",
                "ORGANISATIONS_SUBSCRIPTION.UPDATE",
                "ORGANISATION_FILES.VIEW",
                "ORGANISATION_FILES.CREATE",
                "ORGANISATION_FILES.UPDATE",
                "ORGANISATION_FILES.DELETE",
                "ORGANISATIONS_SETTINGS.VIEW",
                "ORGANISATIONS_SETTINGS.UPDATE",
                "ASSET_CATEGORIES.VIEW",
                "ASSET_CATEGORIES.COMMENT",
                "ASSET_CATEGORIES.CREATE",
                "ASSET_CATEGORIES.UPDATE",
                "ASSET_CATEGORIES.DELETE",
                "ASSET_CATEGORIES.VIEW_DELETED",
                "ASSET_CATEGORIES.RESTORE",
                "CLIENTS.VIEW",
                "CLIENTS.COMMENT",
                "CLIENTS.CREATE",
                "CLIENTS.UPDATE",
                "CLIENTS.DELETE",
                "CLIENTS.VIEW_DELETED",
                "LOCATIONS.VIEW",
                "LOCATIONS.COMMENT",
                "LOCATIONS.CREATE",
                "LOCATIONS.UPDATE",
                "LOCATIONS.DELETE",
                "LOCATIONS.VIEW_DELETED",
                "MANUFACTURERS.VIEW",
                "MANUFACTURERS.COMMENT",
                "MANUFACTURERS.CREATE",
                "MANUFACTURERS.UPDATE",
                "MANUFACTURERS.DELETE",
                "MANUFACTURERS.VIEW_DELETED",
                "ASSET_TYPES.VIEW",
                "ASSET_TYPES.COMMENT",
                "ASSET_TYPES.CREATE",
                "ASSET_TYPES.UPDATE",
                "ASSET_TYPES.DELETE",
                "ASSET_TYPES.VIEW_DELETED",
                "ASSETS.VIEW",
                "ASSETS.COMMENT",
                "ASSETS.CREATE",
                "ASSETS.UPDATE",
                "ASSETS.ARCHIVE",
                "ASSETS.MANAGE_IDS",
                "ASSETS.EDIT_PRICING",
                "ASSETS.ADJUST_STOCK",
                "ASSETS.SCAN",
                "ASSETS.IMPORT",
                "ASSETS.DELETE",
                "ASSETS.VIEW_DELETED",
                "ASSETS.RESTORE",
                "MAINTENANCE_JOBS.VIEW",
                "MAINTENANCE_JOBS.COMMENT",
                "MAINTENANCE_JOBS.CREATE",
                "MAINTENANCE_JOBS.UPDATE",
                "MAINTENANCE_JOBS.FLAG_AND_BLOCK",
                "MAINTENANCE_JOBS.DELETE",
                "PROJECTS.VIEW",
                "PROJECTS.COMMENT",
                "PROJECTS.CREATE",
                "PROJECTS.UPDATE",
                "PROJECTS.DELETE",
                "PROJECTS.VIEW_DELETED",
                "PROJECTS.RESTORE",
                "PROJECT_TEMPLATES.VIEW",
                "PROJECT_TEMPLATES.CREATE",
                "PROJECT_TEMPLATES.UPDATE",
                "PROJECT_TEMPLATES.DELETE",
                "CALENDAR.VIEW",
                "DASHBOARD.VIEW",
                "PROJECT_ASSETS.VIEW",
                "PROJECT_ASSETS.UPDATE",
                "PROJECT_ASSETS.PRICES",
                "QUOTES.VIEW",
                "QUOTES.ISSUE",
                "QUOTES.UPDATE",
                "INVOICES.VIEW",
                "INVOICES.CREATE",
                "INVOICES.ISSUE",
                "INVOICES.CREDIT",
                "PAYMENTS.VIEW",
                "PAYMENTS.RECORD",
                "PAYMENTS.DELETE",
                "PROJECT_CREW.VIEW",
                "PROJECT_CREW.UPDATE",
                "PROJECT_CREW.EMAIL",
                "PROJECT_CREW.RECRUIT",
                "PROJECT_CREW.APPLY",
                "INSPECTIONS.VIEW",
                "INSPECTIONS.RECORD",
                "INSPECTIONS.DELETE",
                "DOCUMENT_TEMPLATES.VIEW",
                "DOCUMENT_TEMPLATES.CREATE",
                "DOCUMENT_TEMPLATES.UPDATE",
                "DOCUMENT_TEMPLATES.DELETE",
                "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
                "ASSET_GROUPS.VIEW",
                "ASSET_GROUPS.CREATE",
                "ASSET_GROUPS.UPDATE",
                "ASSET_GROUPS.DELETE",
                "WIKI_PAGES.VIEW",
                "WIKI_PAGES.CREATE",
                "WIKI_PAGES.UPDATE",
                "WIKI_PAGES.DELETE",
                "WIKI_PAGES.VIEW_STATS",
                "WIKI_PAGES.SET_DASHBOARDS",
                "TRAINING_MODULES.VIEW",
                "TRAINING_MODULES.CREATE",
                "TRAINING_MODULES.UPDATE",
                "TRAINING_MODULES.DELETE",
                "TRAINING_MODULES.VIEW_PROGRESS",
                "CERTIFICATION_TYPES.VIEW",
                "CERTIFICATION_TYPES.CREATE",
                "CERTIFICATION_TYPES.UPDATE",
                "CERTIFICATION_TYPES.DELETE",
                "MEMBER_CERTIFICATIONS.VIEW",
                "MEMBER_CERTIFICATIONS.CREATE",
                "MEMBER_CERTIFICATIONS.UPDATE",
                "MEMBER_CERTIFICATIONS.REVOKE",
                "LABEL_TEMPLATES.VIEW",
                "LABEL_TEMPLATES.CREATE",
                "LABEL_TEMPLATES.UPDATE",
                "LABEL_TEMPLATES.DELETE",
                "PACKAGES.VIEW",
                "PACKAGES.CREATE",
                "PACKAGES.UPDATE",
                "PACKAGES.DELETE",
                "PRICE_STRUCTURES.VIEW",
                "PRICE_STRUCTURES.CREATE",
                "PRICE_STRUCTURES.UPDATE",
                "PRICE_STRUCTURES.DELETE",
                "CLIENT_PRICING.VIEW",
                "CLIENT_PRICING.CREATE",
                "CLIENT_PRICING.UPDATE",
                "CLIENT_PRICING.DELETE",
                "CUSTOM_FIELDS.VIEW",
                "CUSTOM_FIELDS.CREATE",
                "CUSTOM_FIELDS.UPDATE",
                "CUSTOM_FIELDS.DELETE",
                "COMMENTS.VIEW",
                "COMMENTS.UPDATE",
                "SEARCH.VIEW",
                "APPS.VIEW",
                "APPS.CREATE",
                "APPS.UPDATE",
                "APPS.DELETE",
                "APPS.INSTALL",
                "APPS.RUN",
                "APPS.PUBLISH"
              ],
              "description": "A permission, `<AREA>.<ACTION>`, e.g. `CLIENTS.VIEW`"
            }
          },
          "functions": {
            "default": [],
            "description": "Organisation function keys the App may call, e.g. `clients.list`. Every `adamrms.*` call in the code must be listed",
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "egress": {
            "default": [],
            "description": "Hosts the App may fetch over HTTPS. Requests to anything else are refused",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^(\\*\\.)?([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$",
              "description": "A host the App may fetch over HTTPS, e.g. `api.xero.com`, or `*.xero.com` for any subdomain one level down"
            }
          },
          "secrets": {
            "default": [],
            "description": "Secrets an administrator sets on the installation. The code never sees them: it writes `{{secret.NAME}}` in a request's URL, headers or body and the platform fills it in on the way out",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
              "description": "Name of a secret, e.g. `XERO_TOKEN`"
            }
          },
          "settings": {
            "default": {},
            "description": "Settings an administrator fills in on the installation, by name. The code reads them as `ctx.settings.<name>`",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": ["string", "number", "boolean"],
                  "description": "Type of the value"
                },
                "description": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "What the setting is for, shown to the administrator"
                },
                "required": {
                  "default": false,
                  "description": "Whether the App cannot be installed without it",
                  "type": "boolean"
                }
              },
              "required": ["type", "description", "required"],
              "additionalProperties": false
            }
          },
          "hooks": {
            "default": [],
            "description": "Handlers to run when organisation functions are called. An `after` hook gets `{ id, type: \"after\", function, input, output, actor, occurredAt }` once the call has succeeded: `input` is what the function was called with and `output` what it returned, exactly as the HTTP API documents them. A `before` hook gets `{ id, type: \"before\", function, point, input, payload, actor, occurredAt }` before the call takes effect, and returns nothing to let it through, `{ reject: \"why\" }` to refuse it, or `{ change: { ... } }` to change fields of the input (or, at a hook point, of its payload). Hooks do not fire for the App's own calls",
            "maxItems": 50,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "description": "Key of the organisation function to react to, e.g. `clients.create`. It must change data: reads and the Apps functions fire no hooks"
                    },
                    "phase": {
                      "type": "string",
                      "const": "after",
                      "description": "`after`: once the function has succeeded, in the background, never delaying or changing the call"
                    },
                    "handler": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "description": "Name of the exported function to run"
                    }
                  },
                  "required": ["on", "phase", "handler"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 160,
                      "description": "Key of the organisation function to check, e.g. `assets.create`, which must change data; or one of a function's hook points, `<function>:<point>`, e.g. `prices.preview:price-calculated`"
                    },
                    "phase": {
                      "type": "string",
                      "const": "before",
                      "description": "`before`: in the request, before the call takes effect, to let it through, change it or refuse it. The handler has 500 ms, cannot use `fetch`, and can only call functions that read. At most 3 installations can hook one function or point this way"
                    },
                    "handler": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "description": "Name of the exported function to run"
                    },
                    "onFailure": {
                      "default": "reject",
                      "description": "What happens to the call when the handler throws, runs out of time or returns something invalid: `reject` refuses it, `allow` lets it through unchanged. Functions that delete always reject",
                      "type": "string",
                      "enum": ["reject", "allow"]
                    }
                  },
                  "required": ["on", "phase", "handler", "onFailure"],
                  "additionalProperties": false
                }
              ],
              "description": "A handler to run when an organisation function is called"
            }
          },
          "webhooks": {
            "default": [],
            "description": "Handlers third-party services can trigger by POSTing to the installation's URL for each, `/api/v1/apps/webhooks/{organisationUUID}/{installationUUID}/{name}`. Each gets an event `{ id, type: \"webhook\", webhook, method, headers, query, body, receivedAt }`, where `body` is the raw request body as text and `headers` have lower case names",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9-]{0,49}$",
                  "description": "Name of the webhook, unique in the manifest, e.g. `stripe`. It is the last part of its URL"
                },
                "handler": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "Name of the exported function to run"
                },
                "verify": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "scheme": {
                          "type": "string",
                          "const": "hmac-sha256",
                          "description": "The header holds an HMAC-SHA256 of the raw request body, keyed with the secret, as GitHub (`x-hub-signature-256`, hex, prefix `sha256=`), Shopify (`x-shopify-hmac-sha256`, base64) and Xero (`x-xero-signature`, base64) send"
                        },
                        "secret": {
                          "type": "string",
                          "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
                          "description": "The secret holding the signing key. It must be in the manifest's secrets"
                        },
                        "header": {
                          "type": "string",
                          "pattern": "^[a-z0-9-]{1,100}$",
                          "description": "The header holding the signature"
                        },
                        "encoding": {
                          "type": "string",
                          "enum": ["hex", "base64"],
                          "description": "How the signature is written"
                        },
                        "prefix": {
                          "description": "Text before the signature, e.g. `sha256=`",
                          "type": "string",
                          "maxLength": 50
                        }
                      },
                      "required": ["scheme", "secret", "header", "encoding"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "scheme": {
                          "type": "string",
                          "const": "stripe",
                          "description": "Stripe's `Stripe-Signature` header, checked as Stripe documents, refusing events more than 5 minutes old. The delivery id is the event's `id`"
                        },
                        "secret": {
                          "type": "string",
                          "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
                          "description": "The secret holding the endpoint's signing secret (`whsec_...`). It must be in the manifest's secrets"
                        }
                      },
                      "required": ["scheme", "secret"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "scheme": {
                          "type": "string",
                          "const": "token",
                          "description": "The header holds a shared token, compared exactly. The header is removed before the handler sees the request"
                        },
                        "secret": {
                          "type": "string",
                          "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
                          "description": "The secret holding the token. It must be in the manifest's secrets"
                        },
                        "header": {
                          "type": "string",
                          "pattern": "^[a-z0-9-]{1,100}$",
                          "description": "The header holding the token"
                        }
                      },
                      "required": ["scheme", "secret", "header"],
                      "additionalProperties": false
                    }
                  ],
                  "description": "How the platform checks each request came from the service, before any App code runs. Requests that fail are answered 401"
                },
                "mode": {
                  "default": "async",
                  "description": "`async`: the request is answered 202 at once and the handler runs in the background. `sync`: the handler runs in the request, within 5 seconds, and returns the response as `{ status, headers, body }` (only `content-type` and `x-` headers are sent; a string body is sent as-is, anything else as JSON), for services such as Slack that need a computed reply",
                  "type": "string",
                  "enum": ["async", "sync"]
                },
                "deliveryIdHeader": {
                  "description": "A header naming each delivery, e.g. `x-github-delivery`. A delivery that comes again is not run again",
                  "type": "string",
                  "pattern": "^[a-z0-9-]{1,100}$"
                }
              },
              "required": ["name", "handler", "verify", "mode"],
              "additionalProperties": false
            }
          },
          "schedules": {
            "default": [],
            "description": "Handlers to run on a timer, at most one schedule per handler. Each gets an event `{ id, type: \"schedule\", everyMinutes, scheduledFor, occurredAt }`. A run missed while the App was paused is skipped, not caught up",
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "handler": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "Name of the exported function to run"
                },
                "everyMinutes": {
                  "type": "integer",
                  "minimum": 5,
                  "maximum": 10080,
                  "description": "How often to run it, in minutes: 5 to 10080 (a week). The first run is one interval after installing"
                }
              },
              "required": ["handler", "everyMinutes"],
              "additionalProperties": false
            }
          },
          "ui": {
            "default": [],
            "description": "Panels the App adds to pages. Their handlers return components the platform renders, never HTML or script. Anyone who can see the page (and holds the panel's `permission`, if it names one) sees the panel and can use its buttons and forms, which run as the App's bot member",
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slot": {
                  "type": "string",
                  "enum": [
                    "asset.panel",
                    "client.panel",
                    "project-finance.panel"
                  ],
                  "description": "Where the panel appears: `asset.panel`, A panel on each asset's page. The event's `record.uuid` is the asset's UUID; `client.panel`, A panel on each client's page. The event's `record.uuid` is the client's UUID; `project-finance.panel`, A panel on each project's Finance tab, beside its quotes, invoices and payments. The event's `record.uuid` is the project's UUID. At most one panel per slot"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60,
                  "description": "Heading shown above the panel"
                },
                "handler": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "The handler that returns the panel, called with `{ id, type: \"ui-render\", slot, record: { uuid }, actor: { userUuid } }`. It returns a component (see AppUiNode), or null to show nothing. It has 5 seconds and can only call functions that read"
                },
                "actions": {
                  "default": [],
                  "description": "Handlers the panel's buttons and forms may run, each called with `{ id, type: \"ui-action\", slot, record: { uuid }, action, input, values, actor: { userUuid } }`, where `input` is the button's `input` and `values` the form's values. It has 15 seconds, may return `{ message: \"...\" }` to show the member, and the panel is shown again afterwards",
                  "maxItems": 20,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Name of the exported function to run"
                  }
                },
                "permission": {
                  "description": "A permission the viewer needs, as well as the slot's own, to see the panel and use its buttons and forms",
                  "type": "string",
                  "enum": [
                    "AUDIT_LOGS.VIEW",
                    "AI_USAGE.VIEW",
                    "ORGANISATIONS_USERS.VIEW",
                    "ORGANISATIONS_USERS.CREATE",
                    "ORGANISATIONS_USERS.UPDATE",
                    "ORGANISATIONS_USERS.DELETE",
                    "ORGANISATIONS_USERS.VIEW_DELETED",
                    "ORGANISATIONS_USERS.RESTORE",
                    "ORGANISATIONS_USERS.SEND",
                    "ORGANISATIONS_PERMISSIONS.VIEW",
                    "ORGANISATIONS_PERMISSIONS.CREATE",
                    "ORGANISATIONS_PERMISSIONS.UPDATE",
                    "ORGANISATIONS_PERMISSIONS.DELETE",
                    "ORGANISATIONS_PERMISSIONS.VIEW_DELETED",
                    "ORGANISATIONS_PERMISSIONS.RESTORE",
                    "ORGANISATIONS_LICENCES.VIEW",
                    "ORGANISATIONS_LICENCES.UPDATE",
                    "ORGANISATIONS_JOIN_METHODS.VIEW",
                    "ORGANISATIONS_JOIN_METHODS.CREATE",
                    "ORGANISATIONS_JOIN_METHODS.UPDATE",
                    "ORGANISATIONS_JOIN_METHODS.DELETE",
                    "WEBHOOKS.VIEW",
                    "WEBHOOKS.CREATE",
                    "WEBHOOKS.UPDATE",
                    "WEBHOOKS.DELETE",
                    "ORGANISATIONS_SUBSCRIPTION.VIEW",
                    "ORGANISATIONS_SUBSCRIPTION.UPDATE",
                    "ORGANISATION_FILES.VIEW",
                    "ORGANISATION_FILES.CREATE",
                    "ORGANISATION_FILES.UPDATE",
                    "ORGANISATION_FILES.DELETE",
                    "ORGANISATIONS_SETTINGS.VIEW",
                    "ORGANISATIONS_SETTINGS.UPDATE",
                    "ASSET_CATEGORIES.VIEW",
                    "ASSET_CATEGORIES.COMMENT",
                    "ASSET_CATEGORIES.CREATE",
                    "ASSET_CATEGORIES.UPDATE",
                    "ASSET_CATEGORIES.DELETE",
                    "ASSET_CATEGORIES.VIEW_DELETED",
                    "ASSET_CATEGORIES.RESTORE",
                    "CLIENTS.VIEW",
                    "CLIENTS.COMMENT",
                    "CLIENTS.CREATE",
                    "CLIENTS.UPDATE",
                    "CLIENTS.DELETE",
                    "CLIENTS.VIEW_DELETED",
                    "LOCATIONS.VIEW",
                    "LOCATIONS.COMMENT",
                    "LOCATIONS.CREATE",
                    "LOCATIONS.UPDATE",
                    "LOCATIONS.DELETE",
                    "LOCATIONS.VIEW_DELETED",
                    "MANUFACTURERS.VIEW",
                    "MANUFACTURERS.COMMENT",
                    "MANUFACTURERS.CREATE",
                    "MANUFACTURERS.UPDATE",
                    "MANUFACTURERS.DELETE",
                    "MANUFACTURERS.VIEW_DELETED",
                    "ASSET_TYPES.VIEW",
                    "ASSET_TYPES.COMMENT",
                    "ASSET_TYPES.CREATE",
                    "ASSET_TYPES.UPDATE",
                    "ASSET_TYPES.DELETE",
                    "ASSET_TYPES.VIEW_DELETED",
                    "ASSETS.VIEW",
                    "ASSETS.COMMENT",
                    "ASSETS.CREATE",
                    "ASSETS.UPDATE",
                    "ASSETS.ARCHIVE",
                    "ASSETS.MANAGE_IDS",
                    "ASSETS.EDIT_PRICING",
                    "ASSETS.ADJUST_STOCK",
                    "ASSETS.SCAN",
                    "ASSETS.IMPORT",
                    "ASSETS.DELETE",
                    "ASSETS.VIEW_DELETED",
                    "ASSETS.RESTORE",
                    "MAINTENANCE_JOBS.VIEW",
                    "MAINTENANCE_JOBS.COMMENT",
                    "MAINTENANCE_JOBS.CREATE",
                    "MAINTENANCE_JOBS.UPDATE",
                    "MAINTENANCE_JOBS.FLAG_AND_BLOCK",
                    "MAINTENANCE_JOBS.DELETE",
                    "PROJECTS.VIEW",
                    "PROJECTS.COMMENT",
                    "PROJECTS.CREATE",
                    "PROJECTS.UPDATE",
                    "PROJECTS.DELETE",
                    "PROJECTS.VIEW_DELETED",
                    "PROJECTS.RESTORE",
                    "PROJECT_TEMPLATES.VIEW",
                    "PROJECT_TEMPLATES.CREATE",
                    "PROJECT_TEMPLATES.UPDATE",
                    "PROJECT_TEMPLATES.DELETE",
                    "CALENDAR.VIEW",
                    "DASHBOARD.VIEW",
                    "PROJECT_ASSETS.VIEW",
                    "PROJECT_ASSETS.UPDATE",
                    "PROJECT_ASSETS.PRICES",
                    "QUOTES.VIEW",
                    "QUOTES.ISSUE",
                    "QUOTES.UPDATE",
                    "INVOICES.VIEW",
                    "INVOICES.CREATE",
                    "INVOICES.ISSUE",
                    "INVOICES.CREDIT",
                    "PAYMENTS.VIEW",
                    "PAYMENTS.RECORD",
                    "PAYMENTS.DELETE",
                    "PROJECT_CREW.VIEW",
                    "PROJECT_CREW.UPDATE",
                    "PROJECT_CREW.EMAIL",
                    "PROJECT_CREW.RECRUIT",
                    "PROJECT_CREW.APPLY",
                    "INSPECTIONS.VIEW",
                    "INSPECTIONS.RECORD",
                    "INSPECTIONS.DELETE",
                    "DOCUMENT_TEMPLATES.VIEW",
                    "DOCUMENT_TEMPLATES.CREATE",
                    "DOCUMENT_TEMPLATES.UPDATE",
                    "DOCUMENT_TEMPLATES.DELETE",
                    "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
                    "ASSET_GROUPS.VIEW",
                    "ASSET_GROUPS.CREATE",
                    "ASSET_GROUPS.UPDATE",
                    "ASSET_GROUPS.DELETE",
                    "WIKI_PAGES.VIEW",
                    "WIKI_PAGES.CREATE",
                    "WIKI_PAGES.UPDATE",
                    "WIKI_PAGES.DELETE",
                    "WIKI_PAGES.VIEW_STATS",
                    "WIKI_PAGES.SET_DASHBOARDS",
                    "TRAINING_MODULES.VIEW",
                    "TRAINING_MODULES.CREATE",
                    "TRAINING_MODULES.UPDATE",
                    "TRAINING_MODULES.DELETE",
                    "TRAINING_MODULES.VIEW_PROGRESS",
                    "CERTIFICATION_TYPES.VIEW",
                    "CERTIFICATION_TYPES.CREATE",
                    "CERTIFICATION_TYPES.UPDATE",
                    "CERTIFICATION_TYPES.DELETE",
                    "MEMBER_CERTIFICATIONS.VIEW",
                    "MEMBER_CERTIFICATIONS.CREATE",
                    "MEMBER_CERTIFICATIONS.UPDATE",
                    "MEMBER_CERTIFICATIONS.REVOKE",
                    "LABEL_TEMPLATES.VIEW",
                    "LABEL_TEMPLATES.CREATE",
                    "LABEL_TEMPLATES.UPDATE",
                    "LABEL_TEMPLATES.DELETE",
                    "PACKAGES.VIEW",
                    "PACKAGES.CREATE",
                    "PACKAGES.UPDATE",
                    "PACKAGES.DELETE",
                    "PRICE_STRUCTURES.VIEW",
                    "PRICE_STRUCTURES.CREATE",
                    "PRICE_STRUCTURES.UPDATE",
                    "PRICE_STRUCTURES.DELETE",
                    "CLIENT_PRICING.VIEW",
                    "CLIENT_PRICING.CREATE",
                    "CLIENT_PRICING.UPDATE",
                    "CLIENT_PRICING.DELETE",
                    "CUSTOM_FIELDS.VIEW",
                    "CUSTOM_FIELDS.CREATE",
                    "CUSTOM_FIELDS.UPDATE",
                    "CUSTOM_FIELDS.DELETE",
                    "COMMENTS.VIEW",
                    "COMMENTS.UPDATE",
                    "SEARCH.VIEW",
                    "APPS.VIEW",
                    "APPS.CREATE",
                    "APPS.UPDATE",
                    "APPS.DELETE",
                    "APPS.INSTALL",
                    "APPS.RUN",
                    "APPS.PUBLISH"
                  ]
                }
              },
              "required": ["slot", "title", "handler", "actions"],
              "additionalProperties": false
            }
          },
          "provides": {
            "default": [],
            "description": "Organisation functions the App adds, each `app.<App key>.<name>`. Once installed they can be called like built-in functions: through the HTTP API, by AdamRMS AI, and from the App's panels, by anyone holding the function's `permission`. They are not in the OpenAPI document, since each organisation's differ. Other Apps cannot call them",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9-]{0,49}$",
                  "description": "Name of the function, unique in the manifest, e.g. `sync-now`. Its key is `app.<App key>.<name>`, which is also its HTTP path and how AdamRMS AI calls it. Renaming it breaks its callers"
                },
                "summary": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "description": "One line saying what it does, shown in AdamRMS AI and to people approving an AI's request"
                },
                "description": {
                  "description": "A fuller explanation, for AdamRMS AI and API users",
                  "type": "string",
                  "maxLength": 2000
                },
                "kind": {
                  "type": "string",
                  "enum": ["read", "write", "destructive"],
                  "description": "`read`: changes nothing, and its handler can only call functions that read. `write`: creates or changes data. `destructive`: deletes data or is hard to undo, which is pointed out to anyone approving an AI's request to call it"
                },
                "handler": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "The exported handler that does it, called with `{ id, type: \"function\", function, input, actor: { userUuid } }`, where `input` has been checked against `input`. What it returns is the function's result. It has 15 seconds, and a thrown error is returned to the caller as APP_FAILED with its message"
                },
                "input": {
                  "default": {
                    "type": "object",
                    "properties": {}
                  },
                  "description": "JSON Schema of the input: `{ type: \"object\", properties: { ... }, required: [...] }`, where every property has a `description`. Properties not listed are dropped",
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "output": {
                  "description": "JSON Schema of what it returns. If the handler returns something else, the call fails. Without one, any JSON is returned",
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "permission": {
                  "type": "string",
                  "enum": [
                    "AUDIT_LOGS.VIEW",
                    "AI_USAGE.VIEW",
                    "ORGANISATIONS_USERS.VIEW",
                    "ORGANISATIONS_USERS.CREATE",
                    "ORGANISATIONS_USERS.UPDATE",
                    "ORGANISATIONS_USERS.DELETE",
                    "ORGANISATIONS_USERS.VIEW_DELETED",
                    "ORGANISATIONS_USERS.RESTORE",
                    "ORGANISATIONS_USERS.SEND",
                    "ORGANISATIONS_PERMISSIONS.VIEW",
                    "ORGANISATIONS_PERMISSIONS.CREATE",
                    "ORGANISATIONS_PERMISSIONS.UPDATE",
                    "ORGANISATIONS_PERMISSIONS.DELETE",
                    "ORGANISATIONS_PERMISSIONS.VIEW_DELETED",
                    "ORGANISATIONS_PERMISSIONS.RESTORE",
                    "ORGANISATIONS_LICENCES.VIEW",
                    "ORGANISATIONS_LICENCES.UPDATE",
                    "ORGANISATIONS_JOIN_METHODS.VIEW",
                    "ORGANISATIONS_JOIN_METHODS.CREATE",
                    "ORGANISATIONS_JOIN_METHODS.UPDATE",
                    "ORGANISATIONS_JOIN_METHODS.DELETE",
                    "WEBHOOKS.VIEW",
                    "WEBHOOKS.CREATE",
                    "WEBHOOKS.UPDATE",
                    "WEBHOOKS.DELETE",
                    "ORGANISATIONS_SUBSCRIPTION.VIEW",
                    "ORGANISATIONS_SUBSCRIPTION.UPDATE",
                    "ORGANISATION_FILES.VIEW",
                    "ORGANISATION_FILES.CREATE",
                    "ORGANISATION_FILES.UPDATE",
                    "ORGANISATION_FILES.DELETE",
                    "ORGANISATIONS_SETTINGS.VIEW",
                    "ORGANISATIONS_SETTINGS.UPDATE",
                    "ASSET_CATEGORIES.VIEW",
                    "ASSET_CATEGORIES.COMMENT",
                    "ASSET_CATEGORIES.CREATE",
                    "ASSET_CATEGORIES.UPDATE",
                    "ASSET_CATEGORIES.DELETE",
                    "ASSET_CATEGORIES.VIEW_DELETED",
                    "ASSET_CATEGORIES.RESTORE",
                    "CLIENTS.VIEW",
                    "CLIENTS.COMMENT",
                    "CLIENTS.CREATE",
                    "CLIENTS.UPDATE",
                    "CLIENTS.DELETE",
                    "CLIENTS.VIEW_DELETED",
                    "LOCATIONS.VIEW",
                    "LOCATIONS.COMMENT",
                    "LOCATIONS.CREATE",
                    "LOCATIONS.UPDATE",
                    "LOCATIONS.DELETE",
                    "LOCATIONS.VIEW_DELETED",
                    "MANUFACTURERS.VIEW",
                    "MANUFACTURERS.COMMENT",
                    "MANUFACTURERS.CREATE",
                    "MANUFACTURERS.UPDATE",
                    "MANUFACTURERS.DELETE",
                    "MANUFACTURERS.VIEW_DELETED",
                    "ASSET_TYPES.VIEW",
                    "ASSET_TYPES.COMMENT",
                    "ASSET_TYPES.CREATE",
                    "ASSET_TYPES.UPDATE",
                    "ASSET_TYPES.DELETE",
                    "ASSET_TYPES.VIEW_DELETED",
                    "ASSETS.VIEW",
                    "ASSETS.COMMENT",
                    "ASSETS.CREATE",
                    "ASSETS.UPDATE",
                    "ASSETS.ARCHIVE",
                    "ASSETS.MANAGE_IDS",
                    "ASSETS.EDIT_PRICING",
                    "ASSETS.ADJUST_STOCK",
                    "ASSETS.SCAN",
                    "ASSETS.IMPORT",
                    "ASSETS.DELETE",
                    "ASSETS.VIEW_DELETED",
                    "ASSETS.RESTORE",
                    "MAINTENANCE_JOBS.VIEW",
                    "MAINTENANCE_JOBS.COMMENT",
                    "MAINTENANCE_JOBS.CREATE",
                    "MAINTENANCE_JOBS.UPDATE",
                    "MAINTENANCE_JOBS.FLAG_AND_BLOCK",
                    "MAINTENANCE_JOBS.DELETE",
                    "PROJECTS.VIEW",
                    "PROJECTS.COMMENT",
                    "PROJECTS.CREATE",
                    "PROJECTS.UPDATE",
                    "PROJECTS.DELETE",
                    "PROJECTS.VIEW_DELETED",
                    "PROJECTS.RESTORE",
                    "PROJECT_TEMPLATES.VIEW",
                    "PROJECT_TEMPLATES.CREATE",
                    "PROJECT_TEMPLATES.UPDATE",
                    "PROJECT_TEMPLATES.DELETE",
                    "CALENDAR.VIEW",
                    "DASHBOARD.VIEW",
                    "PROJECT_ASSETS.VIEW",
                    "PROJECT_ASSETS.UPDATE",
                    "PROJECT_ASSETS.PRICES",
                    "QUOTES.VIEW",
                    "QUOTES.ISSUE",
                    "QUOTES.UPDATE",
                    "INVOICES.VIEW",
                    "INVOICES.CREATE",
                    "INVOICES.ISSUE",
                    "INVOICES.CREDIT",
                    "PAYMENTS.VIEW",
                    "PAYMENTS.RECORD",
                    "PAYMENTS.DELETE",
                    "PROJECT_CREW.VIEW",
                    "PROJECT_CREW.UPDATE",
                    "PROJECT_CREW.EMAIL",
                    "PROJECT_CREW.RECRUIT",
                    "PROJECT_CREW.APPLY",
                    "INSPECTIONS.VIEW",
                    "INSPECTIONS.RECORD",
                    "INSPECTIONS.DELETE",
                    "DOCUMENT_TEMPLATES.VIEW",
                    "DOCUMENT_TEMPLATES.CREATE",
                    "DOCUMENT_TEMPLATES.UPDATE",
                    "DOCUMENT_TEMPLATES.DELETE",
                    "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
                    "ASSET_GROUPS.VIEW",
                    "ASSET_GROUPS.CREATE",
                    "ASSET_GROUPS.UPDATE",
                    "ASSET_GROUPS.DELETE",
                    "WIKI_PAGES.VIEW",
                    "WIKI_PAGES.CREATE",
                    "WIKI_PAGES.UPDATE",
                    "WIKI_PAGES.DELETE",
                    "WIKI_PAGES.VIEW_STATS",
                    "WIKI_PAGES.SET_DASHBOARDS",
                    "TRAINING_MODULES.VIEW",
                    "TRAINING_MODULES.CREATE",
                    "TRAINING_MODULES.UPDATE",
                    "TRAINING_MODULES.DELETE",
                    "TRAINING_MODULES.VIEW_PROGRESS",
                    "CERTIFICATION_TYPES.VIEW",
                    "CERTIFICATION_TYPES.CREATE",
                    "CERTIFICATION_TYPES.UPDATE",
                    "CERTIFICATION_TYPES.DELETE",
                    "MEMBER_CERTIFICATIONS.VIEW",
                    "MEMBER_CERTIFICATIONS.CREATE",
                    "MEMBER_CERTIFICATIONS.UPDATE",
                    "MEMBER_CERTIFICATIONS.REVOKE",
                    "LABEL_TEMPLATES.VIEW",
                    "LABEL_TEMPLATES.CREATE",
                    "LABEL_TEMPLATES.UPDATE",
                    "LABEL_TEMPLATES.DELETE",
                    "PACKAGES.VIEW",
                    "PACKAGES.CREATE",
                    "PACKAGES.UPDATE",
                    "PACKAGES.DELETE",
                    "PRICE_STRUCTURES.VIEW",
                    "PRICE_STRUCTURES.CREATE",
                    "PRICE_STRUCTURES.UPDATE",
                    "PRICE_STRUCTURES.DELETE",
                    "CLIENT_PRICING.VIEW",
                    "CLIENT_PRICING.CREATE",
                    "CLIENT_PRICING.UPDATE",
                    "CLIENT_PRICING.DELETE",
                    "CUSTOM_FIELDS.VIEW",
                    "CUSTOM_FIELDS.CREATE",
                    "CUSTOM_FIELDS.UPDATE",
                    "CUSTOM_FIELDS.DELETE",
                    "COMMENTS.VIEW",
                    "COMMENTS.UPDATE",
                    "SEARCH.VIEW",
                    "APPS.VIEW",
                    "APPS.CREATE",
                    "APPS.UPDATE",
                    "APPS.DELETE",
                    "APPS.INSTALL",
                    "APPS.RUN",
                    "APPS.PUBLISH"
                  ],
                  "description": "The permission a caller needs, organisation-wide, to call it, e.g. `CLIENTS.VIEW`. The handler itself runs as the App's bot member, with the App's own permissions"
                }
              },
              "required": [
                "name",
                "summary",
                "kind",
                "handler",
                "input",
                "permission"
              ],
              "additionalProperties": false,
              "description": "An organisation function the App adds"
            }
          }
        },
        "required": [
          "permissions",
          "functions",
          "egress",
          "secrets",
          "settings",
          "hooks",
          "webhooks",
          "schedules",
          "ui",
          "provides"
        ],
        "additionalProperties": false,
        "description": "What an App version asks to be allowed to do. Installing it shows an administrator exactly this to approve"
      },
      "AppInstallation": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the installation"
          },
          "appUUID": {
            "type": "string",
            "description": "UUID of the installed App"
          },
          "versionUUID": {
            "type": "string",
            "description": "UUID of the version it runs"
          },
          "version": {
            "type": "string",
            "description": "Label of the version it runs"
          },
          "botUserUuid": {
            "type": "string",
            "description": "UUID of the installation's bot member, which the audit trail records as the actor for everything the App does"
          },
          "approved": {
            "type": "object",
            "properties": {
              "permissions": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Permissions the bot holds"
              },
              "functions": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Functions the App may call"
              },
              "egress": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Hosts the App may fetch"
              },
              "hooks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "string",
                      "description": "Function key, or `<function>:<point>`, it hooks"
                    },
                    "phase": {
                      "type": "string",
                      "enum": ["before", "after"],
                      "description": "When the handler runs"
                    },
                    "handler": {
                      "type": "string",
                      "description": "The handler it runs"
                    },
                    "onFailure": {
                      "description": "For before hooks: what happens to the call when the handler fails",
                      "type": "string",
                      "enum": ["reject", "allow"]
                    }
                  },
                  "required": ["on", "phase", "handler"],
                  "additionalProperties": false
                },
                "description": "Hooks the App reacts to"
              },
              "webhooks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{0,49}$",
                      "description": "Name of the webhook, unique in the manifest, e.g. `stripe`. It is the last part of its URL"
                    },
                    "handler": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "description": "Name of the exported function to run"
                    },
                    "verify": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "scheme": {
                              "type": "string",
                              "const": "hmac-sha256",
                              "description": "The header holds an HMAC-SHA256 of the raw request body, keyed with the secret, as GitHub (`x-hub-signature-256`, hex, prefix `sha256=`), Shopify (`x-shopify-hmac-sha256`, base64) and Xero (`x-xero-signature`, base64) send"
                            },
                            "secret": {
                              "type": "string",
                              "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
                              "description": "The secret holding the signing key. It must be in the manifest's secrets"
                            },
                            "header": {
                              "type": "string",
                              "pattern": "^[a-z0-9-]{1,100}$",
                              "description": "The header holding the signature"
                            },
                            "encoding": {
                              "type": "string",
                              "enum": ["hex", "base64"],
                              "description": "How the signature is written"
                            },
                            "prefix": {
                              "description": "Text before the signature, e.g. `sha256=`",
                              "type": "string",
                              "maxLength": 50
                            }
                          },
                          "required": [
                            "scheme",
                            "secret",
                            "header",
                            "encoding"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "scheme": {
                              "type": "string",
                              "const": "stripe",
                              "description": "Stripe's `Stripe-Signature` header, checked as Stripe documents, refusing events more than 5 minutes old. The delivery id is the event's `id`"
                            },
                            "secret": {
                              "type": "string",
                              "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
                              "description": "The secret holding the endpoint's signing secret (`whsec_...`). It must be in the manifest's secrets"
                            }
                          },
                          "required": ["scheme", "secret"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "scheme": {
                              "type": "string",
                              "const": "token",
                              "description": "The header holds a shared token, compared exactly. The header is removed before the handler sees the request"
                            },
                            "secret": {
                              "type": "string",
                              "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
                              "description": "The secret holding the token. It must be in the manifest's secrets"
                            },
                            "header": {
                              "type": "string",
                              "pattern": "^[a-z0-9-]{1,100}$",
                              "description": "The header holding the token"
                            }
                          },
                          "required": ["scheme", "secret", "header"],
                          "additionalProperties": false
                        }
                      ],
                      "description": "How the platform checks each request came from the service, before any App code runs. Requests that fail are answered 401"
                    },
                    "mode": {
                      "default": "async",
                      "description": "`async`: the request is answered 202 at once and the handler runs in the background. `sync`: the handler runs in the request, within 5 seconds, and returns the response as `{ status, headers, body }` (only `content-type` and `x-` headers are sent; a string body is sent as-is, anything else as JSON), for services such as Slack that need a computed reply",
                      "type": "string",
                      "enum": ["async", "sync"]
                    },
                    "deliveryIdHeader": {
                      "description": "A header naming each delivery, e.g. `x-github-delivery`. A delivery that comes again is not run again",
                      "type": "string",
                      "pattern": "^[a-z0-9-]{1,100}$"
                    },
                    "url": {
                      "type": "string",
                      "description": "The URL to give the service, which it POSTs to"
                    }
                  },
                  "required": ["name", "handler", "verify", "mode", "url"],
                  "additionalProperties": false
                },
                "description": "Webhooks the App can be triggered by"
              },
              "schedules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "handler": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "description": "Name of the exported function to run"
                    },
                    "everyMinutes": {
                      "type": "integer",
                      "minimum": 5,
                      "maximum": 10080,
                      "description": "How often to run it, in minutes: 5 to 10080 (a week). The first run is one interval after installing"
                    },
                    "nextRunAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                      "description": "When it next runs"
                    }
                  },
                  "required": ["handler", "everyMinutes", "nextRunAt"],
                  "additionalProperties": false
                },
                "description": "Handlers the App runs on a timer"
              },
              "ui": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "slot": {
                      "type": "string",
                      "enum": [
                        "asset.panel",
                        "client.panel",
                        "project-finance.panel"
                      ],
                      "description": "Where the panel appears: `asset.panel`, A panel on each asset's page. The event's `record.uuid` is the asset's UUID; `client.panel`, A panel on each client's page. The event's `record.uuid` is the client's UUID; `project-finance.panel`, A panel on each project's Finance tab, beside its quotes, invoices and payments. The event's `record.uuid` is the project's UUID. At most one panel per slot"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 60,
                      "description": "Heading shown above the panel"
                    },
                    "handler": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "description": "The handler that returns the panel, called with `{ id, type: \"ui-render\", slot, record: { uuid }, actor: { userUuid } }`. It returns a component (see AppUiNode), or null to show nothing. It has 5 seconds and can only call functions that read"
                    },
                    "actions": {
                      "default": [],
                      "description": "Handlers the panel's buttons and forms may run, each called with `{ id, type: \"ui-action\", slot, record: { uuid }, action, input, values, actor: { userUuid } }`, where `input` is the button's `input` and `values` the form's values. It has 15 seconds, may return `{ message: \"...\" }` to show the member, and the panel is shown again afterwards",
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "description": "Name of the exported function to run"
                      }
                    },
                    "permission": {
                      "description": "A permission the viewer needs, as well as the slot's own, to see the panel and use its buttons and forms",
                      "type": "string",
                      "enum": [
                        "AUDIT_LOGS.VIEW",
                        "AI_USAGE.VIEW",
                        "ORGANISATIONS_USERS.VIEW",
                        "ORGANISATIONS_USERS.CREATE",
                        "ORGANISATIONS_USERS.UPDATE",
                        "ORGANISATIONS_USERS.DELETE",
                        "ORGANISATIONS_USERS.VIEW_DELETED",
                        "ORGANISATIONS_USERS.RESTORE",
                        "ORGANISATIONS_USERS.SEND",
                        "ORGANISATIONS_PERMISSIONS.VIEW",
                        "ORGANISATIONS_PERMISSIONS.CREATE",
                        "ORGANISATIONS_PERMISSIONS.UPDATE",
                        "ORGANISATIONS_PERMISSIONS.DELETE",
                        "ORGANISATIONS_PERMISSIONS.VIEW_DELETED",
                        "ORGANISATIONS_PERMISSIONS.RESTORE",
                        "ORGANISATIONS_LICENCES.VIEW",
                        "ORGANISATIONS_LICENCES.UPDATE",
                        "ORGANISATIONS_JOIN_METHODS.VIEW",
                        "ORGANISATIONS_JOIN_METHODS.CREATE",
                        "ORGANISATIONS_JOIN_METHODS.UPDATE",
                        "ORGANISATIONS_JOIN_METHODS.DELETE",
                        "WEBHOOKS.VIEW",
                        "WEBHOOKS.CREATE",
                        "WEBHOOKS.UPDATE",
                        "WEBHOOKS.DELETE",
                        "ORGANISATIONS_SUBSCRIPTION.VIEW",
                        "ORGANISATIONS_SUBSCRIPTION.UPDATE",
                        "ORGANISATION_FILES.VIEW",
                        "ORGANISATION_FILES.CREATE",
                        "ORGANISATION_FILES.UPDATE",
                        "ORGANISATION_FILES.DELETE",
                        "ORGANISATIONS_SETTINGS.VIEW",
                        "ORGANISATIONS_SETTINGS.UPDATE",
                        "ASSET_CATEGORIES.VIEW",
                        "ASSET_CATEGORIES.COMMENT",
                        "ASSET_CATEGORIES.CREATE",
                        "ASSET_CATEGORIES.UPDATE",
                        "ASSET_CATEGORIES.DELETE",
                        "ASSET_CATEGORIES.VIEW_DELETED",
                        "ASSET_CATEGORIES.RESTORE",
                        "CLIENTS.VIEW",
                        "CLIENTS.COMMENT",
                        "CLIENTS.CREATE",
                        "CLIENTS.UPDATE",
                        "CLIENTS.DELETE",
                        "CLIENTS.VIEW_DELETED",
                        "LOCATIONS.VIEW",
                        "LOCATIONS.COMMENT",
                        "LOCATIONS.CREATE",
                        "LOCATIONS.UPDATE",
                        "LOCATIONS.DELETE",
                        "LOCATIONS.VIEW_DELETED",
                        "MANUFACTURERS.VIEW",
                        "MANUFACTURERS.COMMENT",
                        "MANUFACTURERS.CREATE",
                        "MANUFACTURERS.UPDATE",
                        "MANUFACTURERS.DELETE",
                        "MANUFACTURERS.VIEW_DELETED",
                        "ASSET_TYPES.VIEW",
                        "ASSET_TYPES.COMMENT",
                        "ASSET_TYPES.CREATE",
                        "ASSET_TYPES.UPDATE",
                        "ASSET_TYPES.DELETE",
                        "ASSET_TYPES.VIEW_DELETED",
                        "ASSETS.VIEW",
                        "ASSETS.COMMENT",
                        "ASSETS.CREATE",
                        "ASSETS.UPDATE",
                        "ASSETS.ARCHIVE",
                        "ASSETS.MANAGE_IDS",
                        "ASSETS.EDIT_PRICING",
                        "ASSETS.ADJUST_STOCK",
                        "ASSETS.SCAN",
                        "ASSETS.IMPORT",
                        "ASSETS.DELETE",
                        "ASSETS.VIEW_DELETED",
                        "ASSETS.RESTORE",
                        "MAINTENANCE_JOBS.VIEW",
                        "MAINTENANCE_JOBS.COMMENT",
                        "MAINTENANCE_JOBS.CREATE",
                        "MAINTENANCE_JOBS.UPDATE",
                        "MAINTENANCE_JOBS.FLAG_AND_BLOCK",
                        "MAINTENANCE_JOBS.DELETE",
                        "PROJECTS.VIEW",
                        "PROJECTS.COMMENT",
                        "PROJECTS.CREATE",
                        "PROJECTS.UPDATE",
                        "PROJECTS.DELETE",
                        "PROJECTS.VIEW_DELETED",
                        "PROJECTS.RESTORE",
                        "PROJECT_TEMPLATES.VIEW",
                        "PROJECT_TEMPLATES.CREATE",
                        "PROJECT_TEMPLATES.UPDATE",
                        "PROJECT_TEMPLATES.DELETE",
                        "CALENDAR.VIEW",
                        "DASHBOARD.VIEW",
                        "PROJECT_ASSETS.VIEW",
                        "PROJECT_ASSETS.UPDATE",
                        "PROJECT_ASSETS.PRICES",
                        "QUOTES.VIEW",
                        "QUOTES.ISSUE",
                        "QUOTES.UPDATE",
                        "INVOICES.VIEW",
                        "INVOICES.CREATE",
                        "INVOICES.ISSUE",
                        "INVOICES.CREDIT",
                        "PAYMENTS.VIEW",
                        "PAYMENTS.RECORD",
                        "PAYMENTS.DELETE",
                        "PROJECT_CREW.VIEW",
                        "PROJECT_CREW.UPDATE",
                        "PROJECT_CREW.EMAIL",
                        "PROJECT_CREW.RECRUIT",
                        "PROJECT_CREW.APPLY",
                        "INSPECTIONS.VIEW",
                        "INSPECTIONS.RECORD",
                        "INSPECTIONS.DELETE",
                        "DOCUMENT_TEMPLATES.VIEW",
                        "DOCUMENT_TEMPLATES.CREATE",
                        "DOCUMENT_TEMPLATES.UPDATE",
                        "DOCUMENT_TEMPLATES.DELETE",
                        "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
                        "ASSET_GROUPS.VIEW",
                        "ASSET_GROUPS.CREATE",
                        "ASSET_GROUPS.UPDATE",
                        "ASSET_GROUPS.DELETE",
                        "WIKI_PAGES.VIEW",
                        "WIKI_PAGES.CREATE",
                        "WIKI_PAGES.UPDATE",
                        "WIKI_PAGES.DELETE",
                        "WIKI_PAGES.VIEW_STATS",
                        "WIKI_PAGES.SET_DASHBOARDS",
                        "TRAINING_MODULES.VIEW",
                        "TRAINING_MODULES.CREATE",
                        "TRAINING_MODULES.UPDATE",
                        "TRAINING_MODULES.DELETE",
                        "TRAINING_MODULES.VIEW_PROGRESS",
                        "CERTIFICATION_TYPES.VIEW",
                        "CERTIFICATION_TYPES.CREATE",
                        "CERTIFICATION_TYPES.UPDATE",
                        "CERTIFICATION_TYPES.DELETE",
                        "MEMBER_CERTIFICATIONS.VIEW",
                        "MEMBER_CERTIFICATIONS.CREATE",
                        "MEMBER_CERTIFICATIONS.UPDATE",
                        "MEMBER_CERTIFICATIONS.REVOKE",
                        "LABEL_TEMPLATES.VIEW",
                        "LABEL_TEMPLATES.CREATE",
                        "LABEL_TEMPLATES.UPDATE",
                        "LABEL_TEMPLATES.DELETE",
                        "PACKAGES.VIEW",
                        "PACKAGES.CREATE",
                        "PACKAGES.UPDATE",
                        "PACKAGES.DELETE",
                        "PRICE_STRUCTURES.VIEW",
                        "PRICE_STRUCTURES.CREATE",
                        "PRICE_STRUCTURES.UPDATE",
                        "PRICE_STRUCTURES.DELETE",
                        "CLIENT_PRICING.VIEW",
                        "CLIENT_PRICING.CREATE",
                        "CLIENT_PRICING.UPDATE",
                        "CLIENT_PRICING.DELETE",
                        "CUSTOM_FIELDS.VIEW",
                        "CUSTOM_FIELDS.CREATE",
                        "CUSTOM_FIELDS.UPDATE",
                        "CUSTOM_FIELDS.DELETE",
                        "COMMENTS.VIEW",
                        "COMMENTS.UPDATE",
                        "SEARCH.VIEW",
                        "APPS.VIEW",
                        "APPS.CREATE",
                        "APPS.UPDATE",
                        "APPS.DELETE",
                        "APPS.INSTALL",
                        "APPS.RUN",
                        "APPS.PUBLISH"
                      ]
                    }
                  },
                  "required": ["slot", "title", "handler", "actions"],
                  "additionalProperties": false
                },
                "description": "Panels the App adds to pages"
              },
              "provides": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{0,49}$",
                      "description": "Name of the function, unique in the manifest, e.g. `sync-now`. Its key is `app.<App key>.<name>`, which is also its HTTP path and how AdamRMS AI calls it. Renaming it breaks its callers"
                    },
                    "summary": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "description": "One line saying what it does, shown in AdamRMS AI and to people approving an AI's request"
                    },
                    "description": {
                      "description": "A fuller explanation, for AdamRMS AI and API users",
                      "type": "string",
                      "maxLength": 2000
                    },
                    "kind": {
                      "type": "string",
                      "enum": ["read", "write", "destructive"],
                      "description": "`read`: changes nothing, and its handler can only call functions that read. `write`: creates or changes data. `destructive`: deletes data or is hard to undo, which is pointed out to anyone approving an AI's request to call it"
                    },
                    "handler": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "description": "The exported handler that does it, called with `{ id, type: \"function\", function, input, actor: { userUuid } }`, where `input` has been checked against `input`. What it returns is the function's result. It has 15 seconds, and a thrown error is returned to the caller as APP_FAILED with its message"
                    },
                    "input": {
                      "default": {
                        "type": "object",
                        "properties": {}
                      },
                      "description": "JSON Schema of the input: `{ type: \"object\", properties: { ... }, required: [...] }`, where every property has a `description`. Properties not listed are dropped",
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "output": {
                      "description": "JSON Schema of what it returns. If the handler returns something else, the call fails. Without one, any JSON is returned",
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "permission": {
                      "type": "string",
                      "enum": [
                        "AUDIT_LOGS.VIEW",
                        "AI_USAGE.VIEW",
                        "ORGANISATIONS_USERS.VIEW",
                        "ORGANISATIONS_USERS.CREATE",
                        "ORGANISATIONS_USERS.UPDATE",
                        "ORGANISATIONS_USERS.DELETE",
                        "ORGANISATIONS_USERS.VIEW_DELETED",
                        "ORGANISATIONS_USERS.RESTORE",
                        "ORGANISATIONS_USERS.SEND",
                        "ORGANISATIONS_PERMISSIONS.VIEW",
                        "ORGANISATIONS_PERMISSIONS.CREATE",
                        "ORGANISATIONS_PERMISSIONS.UPDATE",
                        "ORGANISATIONS_PERMISSIONS.DELETE",
                        "ORGANISATIONS_PERMISSIONS.VIEW_DELETED",
                        "ORGANISATIONS_PERMISSIONS.RESTORE",
                        "ORGANISATIONS_LICENCES.VIEW",
                        "ORGANISATIONS_LICENCES.UPDATE",
                        "ORGANISATIONS_JOIN_METHODS.VIEW",
                        "ORGANISATIONS_JOIN_METHODS.CREATE",
                        "ORGANISATIONS_JOIN_METHODS.UPDATE",
                        "ORGANISATIONS_JOIN_METHODS.DELETE",
                        "WEBHOOKS.VIEW",
                        "WEBHOOKS.CREATE",
                        "WEBHOOKS.UPDATE",
                        "WEBHOOKS.DELETE",
                        "ORGANISATIONS_SUBSCRIPTION.VIEW",
                        "ORGANISATIONS_SUBSCRIPTION.UPDATE",
                        "ORGANISATION_FILES.VIEW",
                        "ORGANISATION_FILES.CREATE",
                        "ORGANISATION_FILES.UPDATE",
                        "ORGANISATION_FILES.DELETE",
                        "ORGANISATIONS_SETTINGS.VIEW",
                        "ORGANISATIONS_SETTINGS.UPDATE",
                        "ASSET_CATEGORIES.VIEW",
                        "ASSET_CATEGORIES.COMMENT",
                        "ASSET_CATEGORIES.CREATE",
                        "ASSET_CATEGORIES.UPDATE",
                        "ASSET_CATEGORIES.DELETE",
                        "ASSET_CATEGORIES.VIEW_DELETED",
                        "ASSET_CATEGORIES.RESTORE",
                        "CLIENTS.VIEW",
                        "CLIENTS.COMMENT",
                        "CLIENTS.CREATE",
                        "CLIENTS.UPDATE",
                        "CLIENTS.DELETE",
                        "CLIENTS.VIEW_DELETED",
                        "LOCATIONS.VIEW",
                        "LOCATIONS.COMMENT",
                        "LOCATIONS.CREATE",
                        "LOCATIONS.UPDATE",
                        "LOCATIONS.DELETE",
                        "LOCATIONS.VIEW_DELETED",
                        "MANUFACTURERS.VIEW",
                        "MANUFACTURERS.COMMENT",
                        "MANUFACTURERS.CREATE",
                        "MANUFACTURERS.UPDATE",
                        "MANUFACTURERS.DELETE",
                        "MANUFACTURERS.VIEW_DELETED",
                        "ASSET_TYPES.VIEW",
                        "ASSET_TYPES.COMMENT",
                        "ASSET_TYPES.CREATE",
                        "ASSET_TYPES.UPDATE",
                        "ASSET_TYPES.DELETE",
                        "ASSET_TYPES.VIEW_DELETED",
                        "ASSETS.VIEW",
                        "ASSETS.COMMENT",
                        "ASSETS.CREATE",
                        "ASSETS.UPDATE",
                        "ASSETS.ARCHIVE",
                        "ASSETS.MANAGE_IDS",
                        "ASSETS.EDIT_PRICING",
                        "ASSETS.ADJUST_STOCK",
                        "ASSETS.SCAN",
                        "ASSETS.IMPORT",
                        "ASSETS.DELETE",
                        "ASSETS.VIEW_DELETED",
                        "ASSETS.RESTORE",
                        "MAINTENANCE_JOBS.VIEW",
                        "MAINTENANCE_JOBS.COMMENT",
                        "MAINTENANCE_JOBS.CREATE",
                        "MAINTENANCE_JOBS.UPDATE",
                        "MAINTENANCE_JOBS.FLAG_AND_BLOCK",
                        "MAINTENANCE_JOBS.DELETE",
                        "PROJECTS.VIEW",
                        "PROJECTS.COMMENT",
                        "PROJECTS.CREATE",
                        "PROJECTS.UPDATE",
                        "PROJECTS.DELETE",
                        "PROJECTS.VIEW_DELETED",
                        "PROJECTS.RESTORE",
                        "PROJECT_TEMPLATES.VIEW",
                        "PROJECT_TEMPLATES.CREATE",
                        "PROJECT_TEMPLATES.UPDATE",
                        "PROJECT_TEMPLATES.DELETE",
                        "CALENDAR.VIEW",
                        "DASHBOARD.VIEW",
                        "PROJECT_ASSETS.VIEW",
                        "PROJECT_ASSETS.UPDATE",
                        "PROJECT_ASSETS.PRICES",
                        "QUOTES.VIEW",
                        "QUOTES.ISSUE",
                        "QUOTES.UPDATE",
                        "INVOICES.VIEW",
                        "INVOICES.CREATE",
                        "INVOICES.ISSUE",
                        "INVOICES.CREDIT",
                        "PAYMENTS.VIEW",
                        "PAYMENTS.RECORD",
                        "PAYMENTS.DELETE",
                        "PROJECT_CREW.VIEW",
                        "PROJECT_CREW.UPDATE",
                        "PROJECT_CREW.EMAIL",
                        "PROJECT_CREW.RECRUIT",
                        "PROJECT_CREW.APPLY",
                        "INSPECTIONS.VIEW",
                        "INSPECTIONS.RECORD",
                        "INSPECTIONS.DELETE",
                        "DOCUMENT_TEMPLATES.VIEW",
                        "DOCUMENT_TEMPLATES.CREATE",
                        "DOCUMENT_TEMPLATES.UPDATE",
                        "DOCUMENT_TEMPLATES.DELETE",
                        "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
                        "ASSET_GROUPS.VIEW",
                        "ASSET_GROUPS.CREATE",
                        "ASSET_GROUPS.UPDATE",
                        "ASSET_GROUPS.DELETE",
                        "WIKI_PAGES.VIEW",
                        "WIKI_PAGES.CREATE",
                        "WIKI_PAGES.UPDATE",
                        "WIKI_PAGES.DELETE",
                        "WIKI_PAGES.VIEW_STATS",
                        "WIKI_PAGES.SET_DASHBOARDS",
                        "TRAINING_MODULES.VIEW",
                        "TRAINING_MODULES.CREATE",
                        "TRAINING_MODULES.UPDATE",
                        "TRAINING_MODULES.DELETE",
                        "TRAINING_MODULES.VIEW_PROGRESS",
                        "CERTIFICATION_TYPES.VIEW",
                        "CERTIFICATION_TYPES.CREATE",
                        "CERTIFICATION_TYPES.UPDATE",
                        "CERTIFICATION_TYPES.DELETE",
                        "MEMBER_CERTIFICATIONS.VIEW",
                        "MEMBER_CERTIFICATIONS.CREATE",
                        "MEMBER_CERTIFICATIONS.UPDATE",
                        "MEMBER_CERTIFICATIONS.REVOKE",
                        "LABEL_TEMPLATES.VIEW",
                        "LABEL_TEMPLATES.CREATE",
                        "LABEL_TEMPLATES.UPDATE",
                        "LABEL_TEMPLATES.DELETE",
                        "PACKAGES.VIEW",
                        "PACKAGES.CREATE",
                        "PACKAGES.UPDATE",
                        "PACKAGES.DELETE",
                        "PRICE_STRUCTURES.VIEW",
                        "PRICE_STRUCTURES.CREATE",
                        "PRICE_STRUCTURES.UPDATE",
                        "PRICE_STRUCTURES.DELETE",
                        "CLIENT_PRICING.VIEW",
                        "CLIENT_PRICING.CREATE",
                        "CLIENT_PRICING.UPDATE",
                        "CLIENT_PRICING.DELETE",
                        "CUSTOM_FIELDS.VIEW",
                        "CUSTOM_FIELDS.CREATE",
                        "CUSTOM_FIELDS.UPDATE",
                        "CUSTOM_FIELDS.DELETE",
                        "COMMENTS.VIEW",
                        "COMMENTS.UPDATE",
                        "SEARCH.VIEW",
                        "APPS.VIEW",
                        "APPS.CREATE",
                        "APPS.UPDATE",
                        "APPS.DELETE",
                        "APPS.INSTALL",
                        "APPS.RUN",
                        "APPS.PUBLISH"
                      ],
                      "description": "The permission a caller needs, organisation-wide, to call it, e.g. `CLIENTS.VIEW`. The handler itself runs as the App's bot member, with the App's own permissions"
                    },
                    "key": {
                      "type": "string",
                      "description": "The function's key, e.g. `app.xero-sync.sync-now`: its HTTP path with dots as slashes"
                    }
                  },
                  "required": [
                    "name",
                    "summary",
                    "kind",
                    "handler",
                    "input",
                    "permission",
                    "key"
                  ],
                  "additionalProperties": false
                },
                "description": "Organisation functions the App adds"
              }
            },
            "required": [
              "permissions",
              "functions",
              "egress",
              "hooks",
              "webhooks",
              "schedules",
              "ui",
              "provides"
            ],
            "additionalProperties": false,
            "description": "What an administrator approved for the installation"
          },
          "settings": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            },
            "description": "The installation's setting values"
          },
          "secrets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Secret name"
                },
                "isSet": {
                  "type": "boolean",
                  "description": "Whether a value has been set"
                },
                "updatedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it was last set, or null if never"
                }
              },
              "required": ["name", "isSet", "updatedAt"],
              "additionalProperties": false
            },
            "description": "The secrets the version declares. Values are write-only and never returned"
          },
          "installedByUserUuid": {
            "type": "string",
            "description": "UUID of the member who installed it"
          },
          "hookOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Where its before hooks run among other Apps' on the same function: lower first, then the earliest installed"
          },
          "pausedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was paused, after its hook, webhook and schedule runs failed too many times in a row, or null if it is running. While paused those triggers do not run. Resume it with apps.resume"
          },
          "pausedReason": {
            "description": "Why it was paused, or null",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was installed"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "appUUID",
          "versionUUID",
          "version",
          "botUserUuid",
          "approved",
          "settings",
          "secrets",
          "installedByUserUuid",
          "hookOrder",
          "pausedAt",
          "pausedReason",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "An App installed in the organisation"
      },
      "AppVersionSummary": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the version"
          },
          "version": {
            "type": "string",
            "description": "The author's label for it, e.g. `1.2.0`"
          },
          "manifest": {
            "$ref": "#/components/schemas/AppManifest"
          },
          "handlers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Functions the code exports, which can be run"
          },
          "codeHash": {
            "type": "string",
            "description": "SHA-256 of the code, hex"
          },
          "apiVersion": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Version of the function API the App was written against"
          },
          "createdByUserUuid": {
            "description": "UUID of the member who created it",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created"
          }
        },
        "required": [
          "uuid",
          "version",
          "manifest",
          "handlers",
          "codeHash",
          "apiVersion",
          "createdByUserUuid",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "An immutable version of an App"
      },
      "AppVersion": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the version"
          },
          "version": {
            "type": "string",
            "description": "The author's label for it, e.g. `1.2.0`"
          },
          "manifest": {
            "$ref": "#/components/schemas/AppManifest"
          },
          "handlers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Functions the code exports, which can be run"
          },
          "codeHash": {
            "type": "string",
            "description": "SHA-256 of the code, hex"
          },
          "apiVersion": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Version of the function API the App was written against"
          },
          "createdByUserUuid": {
            "description": "UUID of the member who created it",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created"
          },
          "appUUID": {
            "type": "string",
            "description": "UUID of the App"
          },
          "code": {
            "type": "string",
            "description": "The App's ES module"
          }
        },
        "required": [
          "uuid",
          "version",
          "manifest",
          "handlers",
          "codeHash",
          "apiVersion",
          "createdByUserUuid",
          "createdAt",
          "appUUID",
          "code"
        ],
        "additionalProperties": false,
        "description": "An immutable version of an App, with its code"
      },
      "App": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the App"
          },
          "key": {
            "type": "string",
            "description": "Stable identifier, e.g. `xero-sync`"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "description": {
            "description": "What the App does",
            "type": ["string", "null"]
          },
          "listingUUID": {
            "description": "The marketplace listing the App was added from, or null for the organisation's own App. An App from the marketplace gets new versions only from there",
            "type": ["string", "null"]
          },
          "latestVersion": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the newest version"
                  },
                  "version": {
                    "type": "string",
                    "description": "Its label"
                  }
                },
                "required": ["uuid", "version"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The newest version, or null if none has been created"
          },
          "installation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppInstallation"
              },
              {
                "type": "null"
              }
            ],
            "description": "The installation, or null if the App is not installed"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the App was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the App last changed"
          }
        },
        "required": [
          "uuid",
          "key",
          "name",
          "description",
          "listingUUID",
          "latestVersion",
          "installation",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "An App: code the organisation runs in the platform"
      },
      "AppSubmission": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the submission"
          },
          "listingUUID": {
            "type": "string",
            "description": "UUID of the App's marketplace listing"
          },
          "versionUUID": {
            "type": "string",
            "description": "UUID of the version submitted"
          },
          "version": {
            "type": "string",
            "description": "Label of the version submitted"
          },
          "status": {
            "type": "string",
            "enum": ["PENDING", "APPROVED", "REJECTED"],
            "description": "`PENDING`: waiting for AdamRMS to review it. `APPROVED`: listed in the marketplace. `REJECTED`: refused at review, or taken down since"
          },
          "reviewNotes": {
            "description": "What the reviewer said, or null",
            "type": ["string", "null"]
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was submitted"
          },
          "reviewedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was last reviewed, or null while pending"
          }
        },
        "required": [
          "uuid",
          "listingUUID",
          "versionUUID",
          "version",
          "status",
          "reviewNotes",
          "submittedAt",
          "reviewedAt"
        ],
        "additionalProperties": false,
        "description": "A version of an App submitted to the marketplace"
      },
      "AppDetail": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the App"
          },
          "key": {
            "type": "string",
            "description": "Stable identifier, e.g. `xero-sync`"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "description": {
            "description": "What the App does",
            "type": ["string", "null"]
          },
          "listingUUID": {
            "description": "The marketplace listing the App was added from, or null for the organisation's own App. An App from the marketplace gets new versions only from there",
            "type": ["string", "null"]
          },
          "latestVersion": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the newest version"
                  },
                  "version": {
                    "type": "string",
                    "description": "Its label"
                  }
                },
                "required": ["uuid", "version"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The newest version, or null if none has been created"
          },
          "installation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppInstallation"
              },
              {
                "type": "null"
              }
            ],
            "description": "The installation, or null if the App is not installed"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the App was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the App last changed"
          },
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppVersionSummary"
            },
            "description": "Every version, newest first"
          },
          "submissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppSubmission"
            },
            "description": "Versions submitted to the marketplace, newest first. Empty if the App has never been published"
          }
        },
        "required": [
          "uuid",
          "key",
          "name",
          "description",
          "listingUUID",
          "latestVersion",
          "installation",
          "createdAt",
          "updatedAt",
          "versions",
          "submissions"
        ],
        "additionalProperties": false,
        "description": "An App with all its versions"
      },
      "AppRunSummary": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the run"
          },
          "installationUUID": {
            "type": "string",
            "description": "UUID of the installation"
          },
          "versionUUID": {
            "type": "string",
            "description": "UUID of the version that ran"
          },
          "version": {
            "type": "string",
            "description": "Label of the version that ran"
          },
          "handler": {
            "type": "string",
            "description": "The handler that ran"
          },
          "trigger": {
            "type": "string",
            "enum": ["MANUAL", "HOOK", "WEBHOOK", "SCHEDULE", "UI", "FUNCTION"],
            "description": "What started it. `MANUAL`: a member ran it by hand. `HOOK`: an organisation function it hooks finished. `WEBHOOK`: a service called one of its webhooks. `SCHEDULE`: one of its schedules came round. `UI`: a member opened a page showing one of its panels, or used a button or form in one. `FUNCTION`: someone called one of the functions it adds"
          },
          "triggeredByUserUuid": {
            "description": "UUID of the member who started it, for hooks whoever called the function, and null for webhooks and schedules",
            "type": ["string", "null"]
          },
          "eventId": {
            "description": "For hook, webhook and schedule runs, the event's id, also given to the handler as `event.id`. Null for manual runs",
            "type": ["string", "null"]
          },
          "eventFunction": {
            "description": "For hook runs, the function whose call fired it. Null for manual runs",
            "type": ["string", "null"]
          },
          "hookPhase": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["before", "after"]
              },
              {
                "type": "null"
              }
            ],
            "description": "For hook runs, whether it checked the call before it took effect or reacted after it finished. Null for other runs"
          },
          "status": {
            "type": "string",
            "enum": ["RUNNING", "COMPLETED", "FAILED"],
            "description": "Where the run is"
          },
          "error": {
            "description": "Why it failed, or null if it did not",
            "type": ["string", "null"]
          },
          "functionCalls": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many organisation functions it called"
          },
          "requestCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many outbound requests it made or tried to make"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it started"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it finished, or null while running"
          }
        },
        "required": [
          "uuid",
          "installationUUID",
          "versionUUID",
          "version",
          "handler",
          "trigger",
          "triggeredByUserUuid",
          "eventId",
          "eventFunction",
          "hookPhase",
          "status",
          "error",
          "functionCalls",
          "requestCount",
          "createdAt",
          "finishedAt"
        ],
        "additionalProperties": false,
        "description": "One run of an App's handler"
      },
      "AppRun": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the run"
          },
          "installationUUID": {
            "type": "string",
            "description": "UUID of the installation"
          },
          "versionUUID": {
            "type": "string",
            "description": "UUID of the version that ran"
          },
          "version": {
            "type": "string",
            "description": "Label of the version that ran"
          },
          "handler": {
            "type": "string",
            "description": "The handler that ran"
          },
          "trigger": {
            "type": "string",
            "enum": ["MANUAL", "HOOK", "WEBHOOK", "SCHEDULE", "UI", "FUNCTION"],
            "description": "What started it. `MANUAL`: a member ran it by hand. `HOOK`: an organisation function it hooks finished. `WEBHOOK`: a service called one of its webhooks. `SCHEDULE`: one of its schedules came round. `UI`: a member opened a page showing one of its panels, or used a button or form in one. `FUNCTION`: someone called one of the functions it adds"
          },
          "triggeredByUserUuid": {
            "description": "UUID of the member who started it, for hooks whoever called the function, and null for webhooks and schedules",
            "type": ["string", "null"]
          },
          "eventId": {
            "description": "For hook, webhook and schedule runs, the event's id, also given to the handler as `event.id`. Null for manual runs",
            "type": ["string", "null"]
          },
          "eventFunction": {
            "description": "For hook runs, the function whose call fired it. Null for manual runs",
            "type": ["string", "null"]
          },
          "hookPhase": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["before", "after"]
              },
              {
                "type": "null"
              }
            ],
            "description": "For hook runs, whether it checked the call before it took effect or reacted after it finished. Null for other runs"
          },
          "status": {
            "type": "string",
            "enum": ["RUNNING", "COMPLETED", "FAILED"],
            "description": "Where the run is"
          },
          "error": {
            "description": "Why it failed, or null if it did not",
            "type": ["string", "null"]
          },
          "functionCalls": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many organisation functions it called"
          },
          "requestCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many outbound requests it made or tried to make"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it started"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it finished, or null while running"
          },
          "input": {
            "description": "The event the handler was given"
          },
          "result": {
            "description": "What the handler returned"
          },
          "logs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Console output, in order"
          },
          "requests": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "method": {
                  "type": "string",
                  "description": "HTTP method"
                },
                "host": {
                  "type": "string",
                  "description": "Host the request was for"
                },
                "status": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Response status, or null if it was refused or failed"
                },
                "durationMs": {
                  "type": "number",
                  "description": "How long it took"
                },
                "blocked": {
                  "description": "Why the platform refused it, or null if it was sent",
                  "type": ["string", "null"]
                }
              },
              "required": ["method", "host", "status", "durationMs", "blocked"],
              "additionalProperties": false
            },
            "description": "Outbound requests, in order. Bodies are never recorded, nor secrets"
          }
        },
        "required": [
          "uuid",
          "installationUUID",
          "versionUUID",
          "version",
          "handler",
          "trigger",
          "triggeredByUserUuid",
          "eventId",
          "eventFunction",
          "hookPhase",
          "status",
          "error",
          "functionCalls",
          "requestCount",
          "createdAt",
          "finishedAt",
          "input",
          "result",
          "logs",
          "requests"
        ],
        "additionalProperties": false,
        "description": "One run of an App's handler, with its input, output and log"
      },
      "AppListing": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the listing"
          },
          "key": {
            "type": "string",
            "description": "The App's stable identifier"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "description": {
            "description": "What the App does",
            "type": ["string", "null"]
          },
          "publisher": {
            "type": "string",
            "description": "Name of the organisation publishing it"
          },
          "latestVersion": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the newest listed version"
              },
              "version": {
                "type": "string",
                "description": "Its label"
              }
            },
            "required": ["uuid", "version"],
            "additionalProperties": false,
            "description": "The newest version listed"
          },
          "appUUID": {
            "description": "UUID of the App this organisation added from the listing, or null if it has not added it",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was first published"
          }
        },
        "required": [
          "uuid",
          "key",
          "name",
          "description",
          "publisher",
          "latestVersion",
          "appUUID",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "An App in the marketplace"
      },
      "AppListingDetail": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the listing"
          },
          "key": {
            "type": "string",
            "description": "The App's stable identifier"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "description": {
            "description": "What the App does",
            "type": ["string", "null"]
          },
          "publisher": {
            "type": "string",
            "description": "Name of the organisation publishing it"
          },
          "latestVersion": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the newest listed version"
              },
              "version": {
                "type": "string",
                "description": "Its label"
              }
            },
            "required": ["uuid", "version"],
            "additionalProperties": false,
            "description": "The newest version listed"
          },
          "appUUID": {
            "description": "UUID of the App this organisation added from the listing, or null if it has not added it",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was first published"
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the listed version"
                },
                "version": {
                  "type": "string",
                  "description": "Its label"
                },
                "manifest": {
                  "$ref": "#/components/schemas/AppManifest"
                },
                "handlers": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Functions the code exports"
                },
                "codeHash": {
                  "type": "string",
                  "description": "SHA-256 of the code, hex"
                },
                "listedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When it was approved"
                }
              },
              "required": [
                "uuid",
                "version",
                "manifest",
                "handlers",
                "codeHash",
                "listedAt"
              ],
              "additionalProperties": false
            },
            "description": "Every listed version, newest first, with what it asks for. Installing one shows an administrator exactly this"
          }
        },
        "required": [
          "uuid",
          "key",
          "name",
          "description",
          "publisher",
          "latestVersion",
          "appUUID",
          "createdAt",
          "versions"
        ],
        "additionalProperties": false,
        "description": "An App in the marketplace, with its listed versions"
      },
      "AppUiPanel": {
        "type": "object",
        "properties": {
          "installationUUID": {
            "type": "string",
            "description": "UUID of the installation the panel comes from"
          },
          "appName": {
            "type": "string",
            "description": "Name of the App"
          },
          "title": {
            "type": "string",
            "description": "Heading of the panel"
          },
          "tree": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppUiNode"
              },
              {
                "type": "null"
              }
            ],
            "description": "The panel's components, or null if it failed"
          },
          "error": {
            "description": "Why the panel could not be shown, or null",
            "type": ["string", "null"]
          },
          "runUUID": {
            "type": "string",
            "description": "UUID of the run that rendered it"
          }
        },
        "required": [
          "installationUUID",
          "appName",
          "title",
          "tree",
          "error",
          "runUUID"
        ],
        "additionalProperties": false,
        "description": "One App's panel on a page"
      },
      "AssetCategory": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the category"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "description": {
            "description": "Optional explanation of what belongs in the category",
            "type": ["string", "null"]
          },
          "icon": {
            "description": "The category's icon: `tabler:<name>` for an icon from the Tabler library (https://tabler.io/icons, e.g. `tabler:bulb`), or `custom:<uuid>` for one the organisation uploaded. Null for none",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the parent category, or null for a top-level category",
            "type": ["string", "null"]
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position among siblings, 0-based"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the category was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the category was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the category last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "icon",
          "parentUUID",
          "sortOrder",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "An asset category"
      },
      "AssetCategoryTreeNode": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the category"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "description": {
            "description": "Optional explanation of what belongs in the category",
            "type": ["string", "null"]
          },
          "icon": {
            "description": "The category's icon: `tabler:<name>` for an icon from the Tabler library (https://tabler.io/icons, e.g. `tabler:bulb`), or `custom:<uuid>` for one the organisation uploaded. Null for none",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the parent category, or null for a top-level category",
            "type": ["string", "null"]
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position among siblings, 0-based"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the category was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the category was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the category last changed"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetCategoryTreeNode"
            },
            "description": "Child categories, in sort order"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "icon",
          "parentUUID",
          "sortOrder",
          "deletedAt",
          "createdAt",
          "updatedAt",
          "children"
        ],
        "additionalProperties": false,
        "description": "An asset category with its children"
      },
      "AttachmentFolder": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the folder"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "parentUUID": {
            "description": "UUID of the folder it sits in, or null at the top level",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the folder was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the folder last changed"
          }
        },
        "required": ["uuid", "name", "parentUUID", "createdAt", "updatedAt"],
        "additionalProperties": false,
        "description": "A folder of files attached to a record"
      },
      "AttachedFile": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the file"
          },
          "name": {
            "type": "string",
            "description": "Display name, without the extension"
          },
          "originalName": {
            "description": "Name of the file as uploaded, or null for a link",
            "type": ["string", "null"]
          },
          "extension": {
            "type": "string",
            "description": "File extension, e.g. `pdf`, or `link` for a link"
          },
          "mimeType": {
            "description": "Content type, if known",
            "type": ["string", "null"]
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Size in bytes; 0 for a link"
          },
          "isLink": {
            "type": "boolean",
            "description": "Whether this is a link to a URL rather than a stored file"
          },
          "linkUrl": {
            "description": "The URL, for a link",
            "type": ["string", "null"]
          },
          "folderUUID": {
            "description": "UUID of the folder it is in, or null at the top level",
            "type": ["string", "null"]
          },
          "uploadedByUserUuid": {
            "description": "UUID of the user who added it",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was added"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "originalName",
          "extension",
          "mimeType",
          "sizeBytes",
          "isLink",
          "linkUrl",
          "folderUUID",
          "uploadedByUserUuid",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A file or link attached to a record"
      },
      "CustomField": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the field"
          },
          "recordType": {
            "type": "string",
            "enum": ["asset"],
            "description": "The kind of record the field belongs to"
          },
          "name": {
            "type": "string",
            "description": "Label shown on the form"
          },
          "description": {
            "description": "Help text shown under the field",
            "type": ["string", "null"]
          },
          "type": {
            "type": "string",
            "enum": [
              "TEXT",
              "RICH_TEXT",
              "NUMBER",
              "BOOLEAN",
              "DATE",
              "SELECT",
              "URL",
              "FILE",
              "IMAGE"
            ],
            "description": "What kind of value it holds"
          },
          "setOn": {
            "type": "string",
            "enum": ["TYPE", "RECORD", "BOTH"],
            "description": "Where the value is set: TYPE (on the asset type, shared by its assets), RECORD (on each asset) or BOTH (on the asset type, and optionally on an asset to override it)"
          },
          "showOnLabels": {
            "type": "boolean",
            "description": "Whether the value is printed on asset labels"
          },
          "showOnDocuments": {
            "type": "boolean",
            "description": "Whether the asset type's value is printed under its lines on quotes and invoices"
          },
          "showInLists": {
            "type": "boolean",
            "description": "Whether the asset's value is shown beside its asset ID in the list of assets and on its page"
          },
          "requirement": {
            "type": "string",
            "enum": ["OPTIONAL", "REQUIRED", "REQUIRED_FOR_CATEGORIES"],
            "description": "OPTIONAL, REQUIRED on every record, or REQUIRED_FOR_CATEGORIES (required for records in `requiredCategoryUUIDs` or their subcategories)"
          },
          "requiredCategoryUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Asset categories the field is required for, when the requirement is REQUIRED_FOR_CATEGORIES. Empty otherwise"
          },
          "appliesTo": {
            "type": "string",
            "enum": ["ALL", "TYPES"],
            "description": "ALL: on every asset type and its assets. TYPES: only on the asset types in `assetTypeUUIDs` and their assets"
          },
          "assetTypeUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Asset types the field is used by, when `appliesTo` is TYPES. Empty otherwise"
          },
          "maxLength": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "TEXT and RICH_TEXT: maximum characters"
          },
          "decimalPlaces": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "NUMBER: decimal places allowed (0 for whole numbers)"
          },
          "minimum": {
            "description": "NUMBER: smallest value allowed",
            "type": ["number", "null"]
          },
          "maximum": {
            "description": "NUMBER: largest value allowed",
            "type": ["number", "null"]
          },
          "unit": {
            "description": "NUMBER: unit shown after the value",
            "type": ["string", "null"]
          },
          "options": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "SELECT: the choices, in order"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position on the form, 0-based"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the field was deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the field was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the field last changed"
          }
        },
        "required": [
          "uuid",
          "recordType",
          "name",
          "description",
          "type",
          "setOn",
          "showOnLabels",
          "showOnDocuments",
          "showInLists",
          "requirement",
          "requiredCategoryUUIDs",
          "appliesTo",
          "assetTypeUUIDs",
          "maxLength",
          "decimalPlaces",
          "minimum",
          "maximum",
          "unit",
          "options",
          "sortOrder",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A custom field definition"
      },
      "CustomFieldValue": {
        "type": ["string", "number", "boolean", "null"]
      },
      "DocumentDetail": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The field's name, such as Power"
          },
          "type": {
            "type": "string",
            "enum": [
              "TEXT",
              "RICH_TEXT",
              "NUMBER",
              "BOOLEAN",
              "DATE",
              "SELECT",
              "URL",
              "FILE",
              "IMAGE"
            ],
            "description": "The field's type, for how to show the value"
          },
          "value": {
            "description": "The asset type's value: text (rich text as plain text), a number, a date as YYYY-MM-DD, or true/false",
            "type": ["string", "number", "boolean"]
          },
          "unit": {
            "description": "For a NUMBER, the unit the value is in, or null",
            "type": ["string", "null"]
          }
        },
        "required": ["name", "type", "value", "unit"],
        "additionalProperties": false,
        "description": "A custom field marked \"Show on client documents\", with the asset type's value"
      },
      "CommentPerson": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "The user's UUID"
          },
          "name": {
            "description": "The user's name, or null if they are no longer known",
            "type": ["string", "null"]
          }
        },
        "required": ["uuid", "name"],
        "additionalProperties": false,
        "description": "A member of the organisation"
      },
      "CommentAttachment": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the file"
          },
          "filename": {
            "type": "string",
            "description": "Display name of the file"
          },
          "extension": {
            "type": "string",
            "description": "File extension, e.g. `pdf`"
          },
          "mimeType": {
            "description": "MIME type, if known",
            "type": ["string", "null"]
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Size in bytes"
          }
        },
        "required": ["uuid", "filename", "extension", "mimeType", "sizeBytes"],
        "additionalProperties": false,
        "description": "A file attached to a comment"
      },
      "Comment": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the comment"
          },
          "record": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "asset-category",
                  "asset",
                  "asset-type",
                  "client",
                  "client-contact",
                  "location",
                  "maintenance-job",
                  "project",
                  "manufacturer"
                ],
                "description": "The kind of record: `asset-category` (an asset category), `asset` (an asset (one unit, or one bulk lot)), `asset-type` (an asset type (a catalogue entry)), `client` (a client), `client-contact` (a person at a client), `location` (a location), `maintenance-job` (a maintenance job (a fault or piece of work on assets)), `project` (a project (an event, show or hire)), `manufacturer` (a manufacturer of assets)"
              },
              "uuid": {
                "type": "string",
                "description": "UUID of the record"
              },
              "title": {
                "description": "What the record is called, or null if it no longer exists",
                "type": ["string", "null"]
              },
              "deleted": {
                "type": "boolean",
                "description": "Whether the record has been deleted since"
              }
            },
            "required": ["type", "uuid", "title", "deleted"],
            "additionalProperties": false,
            "description": "The record the comment is on"
          },
          "body": {
            "type": "string",
            "description": "The comment, in Markdown. Mentions are links of the form `[@Name](mention:<user uuid>)`"
          },
          "author": {
            "$ref": "#/components/schemas/CommentPerson"
          },
          "assignee": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CommentPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who the comment is assigned to as a task, or null"
          },
          "mentions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommentPerson"
            },
            "description": "People mentioned in the comment"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommentAttachment"
            },
            "description": "Files attached to the comment"
          },
          "resolvedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the comment was marked resolved, or null if it is open"
          },
          "resolvedBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CommentPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who marked it resolved, or null if it is open"
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the comment was archived, or null"
          },
          "editedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the text was last edited, or null if never"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the comment was written"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the comment last changed"
          }
        },
        "required": [
          "uuid",
          "record",
          "body",
          "author",
          "assignee",
          "mentions",
          "attachments",
          "resolvedAt",
          "resolvedBy",
          "archivedAt",
          "editedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A comment on a record"
      },
      "InspectionTemplate": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the template"
          },
          "name": {
            "type": "string",
            "description": "Display name, for example 'PAT'"
          },
          "description": {
            "description": "What the inspection is, or null",
            "type": ["string", "null"]
          },
          "intervalValue": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How often it's due, with `intervalUnit`: for example 12"
          },
          "intervalUnit": {
            "type": "string",
            "enum": ["DAYS", "WEEKS", "MONTHS", "YEARS"],
            "description": "`DAYS`, `WEEKS`, `MONTHS` or `YEARS`"
          },
          "whenOverdue": {
            "type": "string",
            "enum": ["BLOCK", "FLAG"],
            "description": "`BLOCK`: an overdue or failed asset can't be booked onto projects. `FLAG`: it only shows a warning"
          },
          "passNewAssets": {
            "type": "boolean",
            "description": "New assets count as passed, so they're first due one interval after they're added. Otherwise they're due straight away"
          },
          "checkOnReturn": {
            "type": "boolean",
            "description": "Check each asset when it comes back from a project: it's due from the moment it's marked back, until it's inspected again"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "Unique identifier of the line"
                },
                "label": {
                  "type": "string",
                  "description": "What to check, for example 'Earth continuity'"
                },
                "help": {
                  "description": "How to check it, shown to the tester, or null",
                  "type": ["string", "null"]
                },
                "type": {
                  "type": "string",
                  "enum": ["TEXT", "NUMBER", "BOOLEAN", "SELECT"],
                  "description": "`TEXT` (a note), `NUMBER` (a reading), `BOOLEAN` (yes or no) or `SELECT` (one of a list)"
                },
                "required": {
                  "type": "boolean",
                  "description": "The tester must answer it"
                },
                "min": {
                  "description": "NUMBER: a reading below this fails the line, or null",
                  "type": ["number", "null"]
                },
                "max": {
                  "description": "NUMBER: a reading above this fails the line, or null",
                  "type": ["number", "null"]
                },
                "unit": {
                  "description": "NUMBER: what the reading is in, for example 'Ω', or null",
                  "type": ["string", "null"]
                },
                "expected": {
                  "description": "BOOLEAN: the answer that passes. Null for a yes or no that never fails",
                  "type": ["boolean", "null"]
                },
                "options": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100,
                            "description": "What the tester picks, for example 'Damaged'"
                          },
                          "fails": {
                            "default": false,
                            "description": "Choosing this fails the line",
                            "type": "boolean"
                          }
                        },
                        "required": ["label", "fails"],
                        "additionalProperties": false
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "SELECT: the choices, and which fail the line"
                }
              },
              "required": [
                "uuid",
                "label",
                "help",
                "type",
                "required",
                "min",
                "max",
                "unit",
                "expected",
                "options"
              ],
              "additionalProperties": false
            },
            "description": "The checklist, in order"
          },
          "assetTypeUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the asset types it applies to"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the template was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the template last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "intervalValue",
          "intervalUnit",
          "whenOverdue",
          "passNewAssets",
          "checkOnReturn",
          "items",
          "assetTypeUUIDs",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "An inspection template, such as PAT or LOLER"
      },
      "InspectionResult": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the result"
          },
          "template": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the template"
              },
              "name": {
                "type": "string",
                "description": "Name of the template"
              }
            },
            "required": ["uuid", "name"],
            "additionalProperties": false,
            "description": "The inspection done"
          },
          "asset": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the asset"
              },
              "primaryID": {
                "description": "The asset's primary asset ID",
                "type": ["string", "null"]
              },
              "assetTypeName": {
                "type": "string",
                "description": "Name of the asset's type"
              }
            },
            "required": ["uuid", "primaryID", "assetTypeName"],
            "additionalProperties": false,
            "description": "The asset inspected"
          },
          "passed": {
            "type": "boolean",
            "description": "The asset passed"
          },
          "overridden": {
            "type": "boolean",
            "description": "A line failed, but the tester passed the asset anyway"
          },
          "overrideNote": {
            "description": "Why the tester passed it anyway, or null",
            "type": ["string", "null"]
          },
          "testedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was tested"
          },
          "tester": {
            "type": "object",
            "properties": {
              "userUUID": {
                "description": "UUID of the member who tested it, or null for someone from outside",
                "type": ["string", "null"]
              },
              "name": {
                "description": "Name of the tester from outside, or null",
                "type": ["string", "null"]
              },
              "company": {
                "description": "Company of the tester from outside, or null",
                "type": ["string", "null"]
              }
            },
            "required": ["userUUID", "name", "company"],
            "additionalProperties": false,
            "description": "Who tested it"
          },
          "certificateNumber": {
            "description": "The certificate or report number, or null",
            "type": ["string", "null"]
          },
          "testEquipment": {
            "description": "The test equipment used, such as the tester's serial number, or null",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Notes, or null",
            "type": ["string", "null"]
          },
          "answers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "itemUUID": {
                  "type": "string",
                  "description": "UUID of the checklist line"
                },
                "label": {
                  "type": "string",
                  "description": "The line's label"
                },
                "type": {
                  "type": "string",
                  "enum": ["TEXT", "NUMBER", "BOOLEAN", "SELECT"],
                  "description": "The line's type"
                },
                "unit": {
                  "description": "NUMBER: the reading's unit",
                  "type": ["string", "null"]
                },
                "value": {
                  "description": "The answer as entered: text, a number, `true`/`false`, or the chosen option. Null if left blank",
                  "type": ["string", "null"]
                },
                "passed": {
                  "description": "Whether the answer passes. Null for lines that can't fail",
                  "type": ["boolean", "null"]
                }
              },
              "required": [
                "itemUUID",
                "label",
                "type",
                "unit",
                "value",
                "passed"
              ],
              "additionalProperties": false
            },
            "description": "The checklist answers, in the template's order"
          },
          "scanUUID": {
            "description": "UUID of the scan it was recorded with, whose photos go with it",
            "type": ["string", "null"]
          },
          "maintenanceJobUUID": {
            "description": "UUID of the maintenance job the failure opened, or null",
            "type": ["string", "null"]
          },
          "maintenanceJobNumber": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of that job, or null"
          },
          "nextDueAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the asset is next due this inspection after this result. A failed result is due again straight away"
          },
          "recordedByUUID": {
            "description": "UUID of the member who recorded the result",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the result was recorded"
          }
        },
        "required": [
          "uuid",
          "template",
          "asset",
          "passed",
          "overridden",
          "overrideNote",
          "testedAt",
          "tester",
          "certificateNumber",
          "testEquipment",
          "notes",
          "answers",
          "scanUUID",
          "maintenanceJobUUID",
          "maintenanceJobNumber",
          "nextDueAt",
          "recordedByUUID",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "An inspection result"
      },
      "AssetType": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the asset type"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "description": {
            "description": "A description of the type",
            "type": ["string", "null"]
          },
          "productLink": {
            "description": "Link to the manufacturer's product page. A bare domain is saved with https://",
            "type": ["string", "null"]
          },
          "categoryUUID": {
            "type": "string",
            "description": "UUID of the asset category"
          },
          "categoryName": {
            "type": "string",
            "description": "Name of the asset category"
          },
          "manufacturerUUID": {
            "description": "UUID of the manufacturer, or null",
            "type": ["string", "null"]
          },
          "manufacturerName": {
            "description": "Name of the manufacturer, or null",
            "type": ["string", "null"]
          },
          "tracking": {
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"],
            "description": "`INDIVIDUAL`: each unit is its own asset with its own asset IDs (fixtures, desks, radios). `BULK`: stock is held as lots with a quantity (cables, clamps, bulbs)"
          },
          "usage": {
            "type": "string",
            "enum": ["RENTAL", "CONSUMABLE"],
            "description": "`RENTAL`: hired out and returned. `CONSUMABLE`: used up on projects and sold (tape, batteries). Consumables must be tracked in BULK"
          },
          "massMg": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Mass of one unit in milligrams, or null if not recorded"
          },
          "mass": {
            "description": "Mass of one unit in `massUnit`, or null",
            "type": ["number", "null"]
          },
          "massUnit": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["g", "kg", "t", "oz", "lb"]
              },
              {
                "type": "null"
              }
            ],
            "description": "The unit the mass was entered in"
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Hire rate of one unit in the smallest currency unit, or null if not for hire"
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure the type chose, or null for the organisation's default",
            "type": ["string", "null"]
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at, or null for the organisation's default rate",
            "type": ["string", "null"]
          },
          "value": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Replacement value of one unit in the smallest currency unit, or null"
          },
          "turnaroundHours": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Hours a unit stays unavailable after a project ends, while it's checked, cleaned or recharged, such as 24 for a hazer. A unit back from one project can't go out on the next until then. 0 for none. At most 720"
          },
          "thumbnailUUID": {
            "description": "UUID of the type's main thumbnail, or null if it has none. The image is at /{locale}/org/{organisationSlug}/thumbnails/{thumbnailUUID}",
            "type": ["string", "null"]
          },
          "thumbnailUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of all the type's thumbnails, the main one first. Each image is at /{locale}/org/{organisationSlug}/thumbnails/{UUID}"
          },
          "showOnPublicSite": {
            "type": "boolean",
            "description": "Whether the public site's catalogue lists it, when the catalogue shows its category. Defaults to true"
          },
          "customFields": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/CustomFieldValue"
            },
            "description": "Values of the custom fields set on the type, by field UUID. Fields with no value are left out"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the type was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the type was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the type last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "productLink",
          "categoryUUID",
          "categoryName",
          "manufacturerUUID",
          "manufacturerName",
          "tracking",
          "usage",
          "massMg",
          "mass",
          "massUnit",
          "rate",
          "priceStructureUUID",
          "taxRateUUID",
          "value",
          "turnaroundHours",
          "thumbnailUUID",
          "thumbnailUUIDs",
          "showOnPublicSite",
          "customFields",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "An asset type: a catalogue entry whose stock are assets"
      },
      "AssetIdentifier": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the asset ID record"
          },
          "value": {
            "type": "string",
            "description": "The ID as printed or scanned"
          },
          "symbology": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "QR_CODE",
                  "CODE_128",
                  "CODE_39",
                  "CODE_93",
                  "EAN_8",
                  "EAN_13"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What the ID is printed as, or null if not a barcode"
          },
          "isPrimary": {
            "type": "boolean",
            "description": "The ID shown in lists, on labels and on documents"
          },
          "notes": {
            "description": "Notes on the ID",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the ID was added"
          }
        },
        "required": [
          "uuid",
          "value",
          "symbology",
          "isPrimary",
          "notes",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "An asset ID: a value printed on the asset and scanned"
      },
      "Asset": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the asset"
          },
          "primaryID": {
            "type": "string",
            "description": "The asset's primary asset ID"
          },
          "identifiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetIdentifier"
            },
            "description": "Every live asset ID of the asset, primary first"
          },
          "assetTypeUUID": {
            "type": "string",
            "description": "UUID of the asset type"
          },
          "assetTypeName": {
            "type": "string",
            "description": "Name of the asset type"
          },
          "assetTypeThumbnailUUID": {
            "description": "UUID of the asset type's thumbnail, or null if it has none. The image is at /{locale}/org/{organisationSlug}/thumbnails/{assetTypeThumbnailUUID}",
            "type": ["string", "null"]
          },
          "categoryUUID": {
            "type": "string",
            "description": "UUID of the type's category"
          },
          "categoryName": {
            "type": "string",
            "description": "Name of the type's category"
          },
          "manufacturerName": {
            "description": "Name of the type's manufacturer, or null",
            "type": ["string", "null"]
          },
          "tracking": {
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"],
            "description": "From the type: `INDIVIDUAL` (this is one unit) or `BULK` (this is a lot of `quantity` items)"
          },
          "usage": {
            "type": "string",
            "enum": ["RENTAL", "CONSUMABLE"],
            "description": "From the type: `RENTAL` or `CONSUMABLE`"
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "1 for a unit; the number of items in a lot"
          },
          "massMg": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Mass of one item in milligrams: the asset's own, else the type's, else null"
          },
          "mass": {
            "description": "The asset's own mass in `massUnit`, or null if it uses the type's",
            "type": ["number", "null"]
          },
          "massUnit": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["g", "kg", "t", "oz", "lb"]
              },
              {
                "type": "null"
              }
            ],
            "description": "The unit the asset's own mass was entered in"
          },
          "value": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Replacement value of one item: the asset's own, else the type's, else null"
          },
          "valueOverride": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The asset's own replacement value, or null if it uses the type's"
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Hire rate of one item: the asset's own, else the type's, else null (not for hire)"
          },
          "rateOverride": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The asset's own rate, or null if it uses the type's"
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that applies: the asset's own, else the type's, else null for the organisation default",
            "type": ["string", "null"]
          },
          "priceStructureOverrideUUID": {
            "description": "UUID of the asset's own price structure, or null",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the asset it is kept in, or null",
            "type": ["string", "null"]
          },
          "parentPrimaryID": {
            "description": "Primary asset ID of the asset it is kept in, or null",
            "type": ["string", "null"]
          },
          "linkKind": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["PERMANENT", "DEFAULT"]
              },
              {
                "type": "null"
              }
            ],
            "description": "How it goes with its case, or null if it isn't in one"
          },
          "storageLocationUUID": {
            "description": "UUID of the location it is kept at, or null",
            "type": ["string", "null"]
          },
          "storageLocationName": {
            "description": "Name of the location it is kept at, or null",
            "type": ["string", "null"]
          },
          "customFields": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "value": {
                  "$ref": "#/components/schemas/CustomFieldValue"
                },
                "source": {
                  "type": "string",
                  "enum": ["TYPE", "RECORD"],
                  "description": "Whether the value comes from the type or the asset"
                }
              },
              "required": ["value", "source"],
              "additionalProperties": false
            },
            "description": "Custom field values that apply to the asset, by field UUID: its own, or its type's where it has none. Fields with no value are left out"
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the asset was archived (sold, lost, retired), or null"
          },
          "archiveReason": {
            "description": "Why it was archived, or null",
            "type": ["string", "null"]
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the asset was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the asset was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the asset last changed"
          }
        },
        "required": [
          "uuid",
          "primaryID",
          "identifiers",
          "assetTypeUUID",
          "assetTypeName",
          "assetTypeThumbnailUUID",
          "categoryUUID",
          "categoryName",
          "manufacturerName",
          "tracking",
          "usage",
          "quantity",
          "massMg",
          "mass",
          "massUnit",
          "value",
          "valueOverride",
          "rate",
          "rateOverride",
          "priceStructureUUID",
          "priceStructureOverrideUUID",
          "parentUUID",
          "parentPrimaryID",
          "linkKind",
          "storageLocationUUID",
          "storageLocationName",
          "customFields",
          "archivedAt",
          "archiveReason",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "An asset: one individually tracked unit, or one bulk lot"
      },
      "AssetDetail": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the asset"
          },
          "primaryID": {
            "type": "string",
            "description": "The asset's primary asset ID"
          },
          "identifiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetIdentifier"
            },
            "description": "Every live asset ID of the asset, primary first"
          },
          "assetTypeUUID": {
            "type": "string",
            "description": "UUID of the asset type"
          },
          "assetTypeName": {
            "type": "string",
            "description": "Name of the asset type"
          },
          "assetTypeThumbnailUUID": {
            "description": "UUID of the asset type's thumbnail, or null if it has none. The image is at /{locale}/org/{organisationSlug}/thumbnails/{assetTypeThumbnailUUID}",
            "type": ["string", "null"]
          },
          "categoryUUID": {
            "type": "string",
            "description": "UUID of the type's category"
          },
          "categoryName": {
            "type": "string",
            "description": "Name of the type's category"
          },
          "manufacturerName": {
            "description": "Name of the type's manufacturer, or null",
            "type": ["string", "null"]
          },
          "tracking": {
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"],
            "description": "From the type: `INDIVIDUAL` (this is one unit) or `BULK` (this is a lot of `quantity` items)"
          },
          "usage": {
            "type": "string",
            "enum": ["RENTAL", "CONSUMABLE"],
            "description": "From the type: `RENTAL` or `CONSUMABLE`"
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "1 for a unit; the number of items in a lot"
          },
          "massMg": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Mass of one item in milligrams: the asset's own, else the type's, else null"
          },
          "mass": {
            "description": "The asset's own mass in `massUnit`, or null if it uses the type's",
            "type": ["number", "null"]
          },
          "massUnit": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["g", "kg", "t", "oz", "lb"]
              },
              {
                "type": "null"
              }
            ],
            "description": "The unit the asset's own mass was entered in"
          },
          "value": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Replacement value of one item: the asset's own, else the type's, else null"
          },
          "valueOverride": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The asset's own replacement value, or null if it uses the type's"
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Hire rate of one item: the asset's own, else the type's, else null (not for hire)"
          },
          "rateOverride": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The asset's own rate, or null if it uses the type's"
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that applies: the asset's own, else the type's, else null for the organisation default",
            "type": ["string", "null"]
          },
          "priceStructureOverrideUUID": {
            "description": "UUID of the asset's own price structure, or null",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the asset it is kept in, or null",
            "type": ["string", "null"]
          },
          "parentPrimaryID": {
            "description": "Primary asset ID of the asset it is kept in, or null",
            "type": ["string", "null"]
          },
          "linkKind": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["PERMANENT", "DEFAULT"]
              },
              {
                "type": "null"
              }
            ],
            "description": "How it goes with its case, or null if it isn't in one"
          },
          "storageLocationUUID": {
            "description": "UUID of the location it is kept at, or null",
            "type": ["string", "null"]
          },
          "storageLocationName": {
            "description": "Name of the location it is kept at, or null",
            "type": ["string", "null"]
          },
          "customFields": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "value": {
                  "$ref": "#/components/schemas/CustomFieldValue"
                },
                "source": {
                  "type": "string",
                  "enum": ["TYPE", "RECORD"],
                  "description": "Whether the value comes from the type or the asset"
                }
              },
              "required": ["value", "source"],
              "additionalProperties": false
            },
            "description": "Custom field values that apply to the asset, by field UUID: its own, or its type's where it has none. Fields with no value are left out"
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the asset was archived (sold, lost, retired), or null"
          },
          "archiveReason": {
            "description": "Why it was archived, or null",
            "type": ["string", "null"]
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the asset was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the asset was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the asset last changed"
          },
          "path": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the case"
                },
                "primaryID": {
                  "type": "string",
                  "description": "Primary asset ID of the case"
                },
                "assetTypeName": {
                  "type": "string",
                  "description": "Asset type of the case"
                }
              },
              "required": ["uuid", "primaryID", "assetTypeName"],
              "additionalProperties": false
            },
            "description": "The cases it is in, outermost first"
          },
          "contents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Asset"
            },
            "description": "Live assets kept directly in this one"
          },
          "totalMassMg": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Mass of this asset (times its quantity) and everything in it, in milligrams. Items with no mass count as 0"
          },
          "totalValue": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Replacement value of this asset (times its quantity) and everything in it. Items with no value count as 0"
          }
        },
        "required": [
          "uuid",
          "primaryID",
          "identifiers",
          "assetTypeUUID",
          "assetTypeName",
          "assetTypeThumbnailUUID",
          "categoryUUID",
          "categoryName",
          "manufacturerName",
          "tracking",
          "usage",
          "quantity",
          "massMg",
          "mass",
          "massUnit",
          "value",
          "valueOverride",
          "rate",
          "rateOverride",
          "priceStructureUUID",
          "priceStructureOverrideUUID",
          "parentUUID",
          "parentPrimaryID",
          "linkKind",
          "storageLocationUUID",
          "storageLocationName",
          "customFields",
          "archivedAt",
          "archiveReason",
          "deletedAt",
          "createdAt",
          "updatedAt",
          "path",
          "contents",
          "totalMassMg",
          "totalValue"
        ],
        "additionalProperties": false,
        "description": "An asset with its cases, contents and totals"
      },
      "StockMovement": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the movement"
          },
          "delta": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many items were added (or taken, if negative)"
          },
          "reason": {
            "type": "string",
            "enum": [
              "OPENING_BALANCE",
              "PURCHASE",
              "FOUND",
              "WRITE_OFF",
              "CONSUMED",
              "COUNT_CORRECTION",
              "SPLIT",
              "MERGE",
              "IMPORT"
            ],
            "description": "Why the stock changed"
          },
          "note": {
            "description": "A note on the change, or null",
            "type": ["string", "null"]
          },
          "byUserUUID": {
            "description": "UUID of the user who recorded it, or null",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was recorded"
          }
        },
        "required": [
          "uuid",
          "delta",
          "reason",
          "note",
          "byUserUUID",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "One change to a lot's quantity"
      },
      "MaintenanceStatus": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the status"
          },
          "name": {
            "type": "string",
            "description": "Display name, for example 'Received'"
          },
          "isOpen": {
            "type": "boolean",
            "description": "Whether a job in this status is still open. Jobs in a closed status leave the main list, and their flags and blocks stop applying"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position in the list, 0-based"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the status was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the status last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "isOpen",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A maintenance job status"
      },
      "MaintenancePriority": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the priority"
          },
          "name": {
            "type": "string",
            "description": "Display name, for example 'Urgent'"
          },
          "colour": {
            "type": "string",
            "enum": ["red", "yellow", "green", "blue", "gray"],
            "description": "Colour of the priority's badge"
          },
          "isDefault": {
            "type": "boolean",
            "description": "New jobs get this priority unless another is given"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position in the list, 0-based. The most urgent comes first"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the priority was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the priority last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "colour",
          "isDefault",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A maintenance job priority"
      },
      "MaintenanceJob": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the job"
          },
          "number": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The job's number in the organisation, for example 42"
          },
          "title": {
            "type": "string",
            "description": "Short summary of the fault or work"
          },
          "description": {
            "description": "What's wrong, in more detail",
            "type": ["string", "null"]
          },
          "status": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "Unique identifier of the status"
              },
              "name": {
                "type": "string",
                "description": "Display name, for example 'Received'"
              },
              "isOpen": {
                "type": "boolean",
                "description": "Whether a job in this status is still open. Jobs in a closed status leave the main list, and their flags and blocks stop applying"
              }
            },
            "required": ["uuid", "name", "isOpen"],
            "additionalProperties": false,
            "description": "Where the job is up to"
          },
          "priority": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "Unique identifier of the priority"
              },
              "name": {
                "type": "string",
                "description": "Display name, for example 'Urgent'"
              },
              "colour": {
                "type": "string",
                "enum": ["red", "yellow", "green", "blue", "gray"],
                "description": "Colour of the priority's badge"
              }
            },
            "required": ["uuid", "name", "colour"],
            "additionalProperties": false,
            "description": "How urgent it is"
          },
          "assigneeUUID": {
            "description": "UUID of the member it's assigned to, or null",
            "type": ["string", "null"]
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it should be done by, or null"
          },
          "flagAssets": {
            "type": "boolean",
            "description": "While the job is open, its assets show a warning wherever they appear"
          },
          "blockAssets": {
            "type": "boolean",
            "description": "While the job is open, its assets can't be booked onto projects"
          },
          "cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "What the work cost, in the smallest unit of the organisation's currency (pence for GBP), or null"
          },
          "supplier": {
            "description": "Who did the work if it went out, or null",
            "type": ["string", "null"]
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["REPAIRED", "NO_FAULT_FOUND", "BEYOND_REPAIR"]
              },
              {
                "type": "null"
              }
            ],
            "description": "How it ended: `REPAIRED`, `NO_FAULT_FOUND` or `BEYOND_REPAIR`. Null if not given"
          },
          "closedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the job moved into a closed status, or null if open"
          },
          "createdByUUID": {
            "description": "UUID of the member who created the job, or null",
            "type": ["string", "null"]
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "description": "UUID of the asset"
                },
                "primaryID": {
                  "description": "The asset's primary asset ID, or null if it has none",
                  "type": ["string", "null"]
                },
                "assetTypeUUID": {
                  "type": "string",
                  "description": "UUID of the asset's type"
                },
                "assetTypeName": {
                  "type": "string",
                  "description": "Name of the asset's type"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many of it the job covers: 1 for an individually tracked unit, up to the lot's quantity for a bulk lot"
                },
                "released": {
                  "type": "boolean",
                  "description": "The job's flag and block were lifted from this asset early, such as once it was fixed"
                },
                "archived": {
                  "type": "boolean",
                  "description": "The asset has since been archived"
                }
              },
              "required": [
                "assetUUID",
                "primaryID",
                "assetTypeUUID",
                "assetTypeName",
                "quantity",
                "released",
                "archived"
              ],
              "additionalProperties": false
            },
            "description": "The assets the job covers"
          },
          "watcherUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the members watching the job"
          },
          "costs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "Unique identifier of the item"
                },
                "kind": {
                  "type": "string",
                  "enum": ["PART", "LABOUR", "OTHER"],
                  "description": "`PART`, `LABOUR` (quantity is hours) or `OTHER`"
                },
                "description": {
                  "type": "string",
                  "description": "What it was, such as 'Replacement fan'"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many, or hours of labour"
                },
                "unitCost": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Each, in the smallest unit of the organisation's currency"
                }
              },
              "required": [
                "uuid",
                "kind",
                "description",
                "quantity",
                "unitCost"
              ],
              "additionalProperties": false
            },
            "description": "What it cost, item by item: parts, labour and anything else. When there are items, `cost` is their total"
          },
          "charge": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "lineUUID": {
                    "type": "string",
                    "description": "UUID of the line on the project"
                  },
                  "project": {
                    "type": "object",
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "description": "UUID of the project"
                      },
                      "number": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991,
                        "description": "The project's number"
                      },
                      "name": {
                        "type": "string",
                        "description": "The project's name"
                      }
                    },
                    "required": ["uuid", "number", "name"],
                    "additionalProperties": false,
                    "description": "The project it's charged to"
                  },
                  "description": {
                    "type": "string",
                    "description": "The line's description"
                  },
                  "amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "What the line charges, before any discount, in the smallest currency unit"
                  }
                },
                "required": ["lineUUID", "project", "description", "amount"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The line charging the client for the work, such as a repair after a hire, or null"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the job was deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the job was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the job last changed"
          }
        },
        "required": [
          "uuid",
          "number",
          "title",
          "description",
          "status",
          "priority",
          "assigneeUUID",
          "dueAt",
          "flagAssets",
          "blockAssets",
          "cost",
          "supplier",
          "outcome",
          "closedAt",
          "createdByUUID",
          "assets",
          "watcherUUIDs",
          "costs",
          "charge",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A maintenance job"
      },
      "Icon": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the icon. Choose it for a category with the icon `custom:<uuid>`"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "contentType": {
            "type": "string",
            "enum": ["image/svg+xml", "image/png", "image/webp"],
            "description": "Image format"
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Size of the image in bytes"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the icon was uploaded"
          }
        },
        "required": ["uuid", "name", "contentType", "sizeBytes", "createdAt"],
        "additionalProperties": false,
        "description": "An icon uploaded by the organisation"
      },
      "LegacyImportRun": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the run"
          },
          "status": {
            "type": "string",
            "enum": ["RUNNING", "COMPLETED", "FAILED", "CANCELLED"],
            "description": "RUNNING, COMPLETED, FAILED (stopped by an error) or CANCELLED"
          },
          "startedByUserUuid": {
            "type": "string",
            "description": "UUID of the member who started the run, and whom it acts as"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the run started"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the run ended, or null while it is running"
          },
          "currentEntity": {
            "description": "The kind of record the run is working on, or null once it has ended",
            "type": ["string", "null"]
          },
          "counts": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "created": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Records created here"
                },
                "updated": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Records changed here because they changed in the previous version"
                },
                "unchanged": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Records already up to date, which were left alone"
                },
                "removed": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Records deleted or archived here because they were deleted in the previous version"
                },
                "skipped": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Records that couldn't be imported. Each has an issue in the run"
                }
              },
              "required": [
                "created",
                "updated",
                "unchanged",
                "removed",
                "skipped"
              ],
              "additionalProperties": false,
              "description": "What a run did with one kind of record"
            },
            "description": "What the run did, by kind of record, e.g. `manufacturers` or `assets`"
          },
          "issueCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many records couldn't be imported. At most 1,000 are listed"
          }
        },
        "required": [
          "uuid",
          "status",
          "startedByUserUuid",
          "startedAt",
          "finishedAt",
          "currentEntity",
          "counts",
          "issueCount"
        ],
        "additionalProperties": false,
        "description": "One import from the previous version of AdamRMS"
      },
      "Manufacturer": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the manufacturer"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "parentUUID": {
            "description": "UUID of the parent company (e.g. Harman for JBL), or null for a top-level manufacturer",
            "type": ["string", "null"]
          },
          "website": {
            "description": "The manufacturer's website, or null if not recorded",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Free-text notes about the manufacturer, or null",
            "type": ["string", "null"]
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the manufacturer was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the manufacturer was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the manufacturer last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "parentUUID",
          "website",
          "notes",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A manufacturer of assets"
      },
      "ManufacturerTreeNode": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the manufacturer"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "parentUUID": {
            "description": "UUID of the parent company (e.g. Harman for JBL), or null for a top-level manufacturer",
            "type": ["string", "null"]
          },
          "website": {
            "description": "The manufacturer's website, or null if not recorded",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Free-text notes about the manufacturer, or null",
            "type": ["string", "null"]
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the manufacturer was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the manufacturer was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the manufacturer last changed"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManufacturerTreeNode"
            },
            "description": "Manufacturers whose parent company this is, sorted the same way"
          }
        },
        "required": [
          "uuid",
          "name",
          "parentUUID",
          "website",
          "notes",
          "deletedAt",
          "createdAt",
          "updatedAt",
          "children"
        ],
        "additionalProperties": false,
        "description": "A manufacturer with the manufacturers it owns"
      },
      "Accessory": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "type": "string",
            "description": "UUID of the accessory's asset type"
          },
          "assetTypeName": {
            "type": "string",
            "description": "Name of the accessory's asset type"
          },
          "tracking": {
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"],
            "description": "Whether the accessory is tracked as individual units or in bulk lots"
          },
          "thumbnailUUID": {
            "description": "The accessory type's main thumbnail, or null",
            "type": ["string", "null"]
          },
          "hasAccessories": {
            "type": "boolean",
            "description": "True if the accessory has accessories of its own"
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many of the accessory go out with one of the asset type"
          },
          "mode": {
            "type": "string",
            "enum": ["MANDATORY", "DEFAULT", "OPTIONAL"],
            "description": "How the accessory goes out with the asset type: MANDATORY (always, and it can't be left out), DEFAULT (unless it is taken out of the booking) or OPTIONAL (only if it is added, as an extra)"
          }
        },
        "required": [
          "assetTypeUUID",
          "assetTypeName",
          "tracking",
          "thumbnailUUID",
          "hasAccessories",
          "quantity",
          "mode"
        ],
        "additionalProperties": false,
        "description": "One accessory of an asset type"
      },
      "Accessories": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "type": "string",
            "description": "UUID of the asset type"
          },
          "accessories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Accessory"
            },
            "description": "The asset types that go out with this one, in order. Empty if it has none. Deleted asset types are left out"
          },
          "accessoryOf": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetTypeUUID": {
                  "type": "string",
                  "description": "UUID of the asset type"
                },
                "assetTypeName": {
                  "type": "string",
                  "description": "Name of the asset type"
                }
              },
              "required": ["assetTypeUUID", "assetTypeName"],
              "additionalProperties": false
            },
            "description": "The asset types this one is an accessory of, by name"
          }
        },
        "required": ["assetTypeUUID", "accessories", "accessoryOf"],
        "additionalProperties": false,
        "description": "An asset type's accessories: the other asset types that go out with it, such as the clamp, safety bond and colour frame with a lantern"
      },
      "PackageContent": {
        "type": "object",
        "properties": {
          "assetTypeUUID": {
            "type": "string",
            "description": "UUID of the asset type"
          },
          "assetTypeName": {
            "type": "string",
            "description": "Name of the asset type"
          },
          "tracking": {
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"],
            "description": "Whether the asset type is tracked as individual units or in bulk lots"
          },
          "thumbnailUUID": {
            "description": "The asset type's main thumbnail, or null",
            "type": ["string", "null"]
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many of the asset type go out with one package"
          },
          "mode": {
            "type": "string",
            "enum": ["MANDATORY", "DEFAULT", "OPTIONAL"],
            "description": "How the asset type goes out with the package: MANDATORY (always, and it can't be left out), DEFAULT (unless it is taken out of the booking) or OPTIONAL (only if it is added, as an extra)"
          }
        },
        "required": [
          "assetTypeUUID",
          "assetTypeName",
          "tracking",
          "thumbnailUUID",
          "quantity",
          "mode"
        ],
        "additionalProperties": false,
        "description": "One asset type in a package"
      },
      "PackageSummary": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the package"
          },
          "name": {
            "type": "string",
            "description": "Display name, such as 'Small PA package'"
          },
          "description": {
            "description": "What the package is for, or null",
            "type": ["string", "null"]
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Hire rate of the whole package in the smallest currency unit (such as pence). How the hire's length multiplies it is set by the price structure. Null if it has no rate"
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that sets how the length of a hire multiplies the rate. Null for the organisation's default",
            "type": ["string", "null"]
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at, or null for the organisation's default rate",
            "type": ["string", "null"]
          },
          "showOnPublicSite": {
            "type": "boolean",
            "description": "Whether the public site's catalogue lists it, when the catalogue shows packages. Defaults to true"
          },
          "contentCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many asset types are in the package, not counting deleted ones"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the package was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the package last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "rate",
          "priceStructureUUID",
          "taxRateUUID",
          "showOnPublicSite",
          "contentCount",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A bundle of asset types hired out together at one price, such as a small PA package"
      },
      "Package": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the package"
          },
          "name": {
            "type": "string",
            "description": "Display name, such as 'Small PA package'"
          },
          "description": {
            "description": "What the package is for, or null",
            "type": ["string", "null"]
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Hire rate of the whole package in the smallest currency unit (such as pence). How the hire's length multiplies it is set by the price structure. Null if it has no rate"
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that sets how the length of a hire multiplies the rate. Null for the organisation's default",
            "type": ["string", "null"]
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at, or null for the organisation's default rate",
            "type": ["string", "null"]
          },
          "showOnPublicSite": {
            "type": "boolean",
            "description": "Whether the public site's catalogue lists it, when the catalogue shows packages. Defaults to true"
          },
          "contentCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many asset types are in the package, not counting deleted ones"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the package was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the package last changed"
          },
          "contents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PackageContent"
            },
            "description": "The asset types in the package, in order. Deleted asset types are left out"
          },
          "value": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Replacement value of everything that always goes out in the package, in the smallest currency unit. Optional extras and types with no value aren't counted"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "rate",
          "priceStructureUUID",
          "taxRateUUID",
          "showOnPublicSite",
          "contentCount",
          "createdAt",
          "updatedAt",
          "contents",
          "value"
        ],
        "additionalProperties": false,
        "description": "A bundle of asset types hired out together at one price, such as a small PA package, with what is in it"
      },
      "AssetGroup": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the asset group"
          },
          "name": {
            "type": "string",
            "description": "Display name, such as 'Touring rig A'"
          },
          "description": {
            "description": "What the group is for, or null",
            "type": ["string", "null"]
          },
          "personal": {
            "type": "boolean",
            "description": "True for a personal group, which only the member who made it can see. False for a group shared with the organisation"
          },
          "assetCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many assets are in the group, not counting deleted ones"
          },
          "watching": {
            "type": "boolean",
            "description": "True if the caller watches the group, and is emailed when assets are added to it or taken out"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the group was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the group last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "personal",
          "assetCount",
          "watching",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A named list of assets, such as the rig for one tour. An asset can be in several groups"
      },
      "LabelElement": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "BARCODE"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32,
                "description": "The element's own ID, unique on the template"
              },
              "x": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's left edge, in millimetres"
              },
              "y": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's top edge, in millimetres"
              },
              "width": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Width, in millimetres"
              },
              "height": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Height, in millimetres"
              },
              "rotation": {
                "default": 0,
                "description": "Clockwise rotation in degrees, about the element's centre",
                "anyOf": [
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 90
                  },
                  {
                    "type": "number",
                    "const": 180
                  },
                  {
                    "type": "number",
                    "const": 270
                  }
                ]
              },
              "symbology": {
                "type": "string",
                "enum": [
                  "QR_CODE",
                  "CODE_128",
                  "CODE_39",
                  "CODE_93",
                  "EAN_8",
                  "EAN_13"
                ],
                "description": "How the barcode is drawn. An asset label encodes the asset's primary asset ID, a location label the location's own code"
              }
            },
            "required": [
              "type",
              "id",
              "x",
              "y",
              "width",
              "height",
              "rotation",
              "symbology"
            ],
            "additionalProperties": false,
            "description": "The barcode that scans as the asset or location"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "TEXT"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32,
                "description": "The element's own ID, unique on the template"
              },
              "x": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's left edge, in millimetres"
              },
              "y": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's top edge, in millimetres"
              },
              "width": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Width, in millimetres"
              },
              "height": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Height, in millimetres"
              },
              "rotation": {
                "default": 0,
                "description": "Clockwise rotation in degrees, about the element's centre",
                "anyOf": [
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 90
                  },
                  {
                    "type": "number",
                    "const": 180
                  },
                  {
                    "type": "number",
                    "const": 270
                  }
                ]
              },
              "field": {
                "type": "string",
                "enum": [
                  "FIXED",
                  "ORGANISATION_NAME",
                  "ASSET_ID",
                  "ASSET_TYPE",
                  "MANUFACTURER",
                  "CATEGORY",
                  "MASS",
                  "VALUE",
                  "CUSTOM_FIELD",
                  "LABEL_CUSTOM_FIELDS",
                  "LOCATION_NAME",
                  "LOCATION_PARENT"
                ],
                "description": "What the text shows. LABEL_CUSTOM_FIELDS is every custom field marked to show on labels, as 'Name: value', one after another"
              },
              "customFieldUUID": {
                "default": null,
                "description": "For CUSTOM_FIELD: the custom field to show",
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "text": {
                "default": "",
                "description": "For FIXED: the text itself. For any other field: shown before the value, such as 'Mass: '",
                "type": "string",
                "maxLength": 200
              },
              "fontSize": {
                "default": 10,
                "description": "Text size in points",
                "type": "number",
                "minimum": 3,
                "maximum": 96
              },
              "bold": {
                "default": false,
                "description": "Bold text",
                "type": "boolean"
              },
              "align": {
                "default": "LEFT",
                "description": "How the text lines up in its box",
                "type": "string",
                "enum": ["LEFT", "CENTRE", "RIGHT"]
              }
            },
            "required": [
              "type",
              "id",
              "x",
              "y",
              "width",
              "height",
              "rotation",
              "field",
              "customFieldUUID",
              "text",
              "fontSize",
              "bold",
              "align"
            ],
            "additionalProperties": false,
            "description": "A line of text"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "LOGO"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32,
                "description": "The element's own ID, unique on the template"
              },
              "x": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's left edge, in millimetres"
              },
              "y": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's top edge, in millimetres"
              },
              "width": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Width, in millimetres"
              },
              "height": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Height, in millimetres"
              },
              "rotation": {
                "default": 0,
                "description": "Clockwise rotation in degrees, about the element's centre",
                "anyOf": [
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 90
                  },
                  {
                    "type": "number",
                    "const": 180
                  },
                  {
                    "type": "number",
                    "const": 270
                  }
                ]
              }
            },
            "required": ["type", "id", "x", "y", "width", "height", "rotation"],
            "additionalProperties": false,
            "description": "The organisation's logo, fitted inside the box"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "COLOUR_BAND"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32,
                "description": "The element's own ID, unique on the template"
              },
              "x": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's left edge, in millimetres"
              },
              "y": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's top edge, in millimetres"
              },
              "width": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Width, in millimetres"
              },
              "height": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Height, in millimetres"
              },
              "rotation": {
                "default": 0,
                "description": "Clockwise rotation in degrees, about the element's centre",
                "anyOf": [
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 90
                  },
                  {
                    "type": "number",
                    "const": 180
                  },
                  {
                    "type": "number",
                    "const": 270
                  }
                ]
              },
              "customFieldUUID": {
                "default": null,
                "description": "The custom field whose value picks the colour, such as a cable's length",
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "colours": {
                "default": [],
                "description": "The colour for each value, matched ignoring case. Any other value leaves the band blank",
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "description": "A value of the field, such as '10m'"
                    },
                    "colour": {
                      "type": "string",
                      "pattern": "^#[0-9a-fA-F]{6}$",
                      "description": "Colour as #rrggbb"
                    }
                  },
                  "required": ["value", "colour"],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "id",
              "x",
              "y",
              "width",
              "height",
              "rotation",
              "customFieldUUID",
              "colours"
            ],
            "additionalProperties": false,
            "description": "A block of colour picked by a custom field, such as the colour code for a cable's length"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "BOX"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32,
                "description": "The element's own ID, unique on the template"
              },
              "x": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's left edge, in millimetres"
              },
              "y": {
                "type": "number",
                "minimum": 0,
                "maximum": 300,
                "description": "Distance from the label's top edge, in millimetres"
              },
              "width": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Width, in millimetres"
              },
              "height": {
                "type": "number",
                "minimum": 0.5,
                "maximum": 300,
                "description": "Height, in millimetres"
              },
              "rotation": {
                "default": 0,
                "description": "Clockwise rotation in degrees, about the element's centre",
                "anyOf": [
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 90
                  },
                  {
                    "type": "number",
                    "const": 180
                  },
                  {
                    "type": "number",
                    "const": 270
                  }
                ]
              },
              "filled": {
                "default": false,
                "description": "Filled black, rather than an outline",
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "x",
              "y",
              "width",
              "height",
              "rotation",
              "filled"
            ],
            "additionalProperties": false,
            "description": "A rectangle: an outline or a filled block"
          }
        ],
        "description": "One thing drawn on the label"
      },
      "LabelSheet": {
        "type": "object",
        "properties": {
          "paper": {
            "type": "string",
            "enum": ["A4", "LETTER"],
            "description": "The sheet's paper size"
          },
          "columns": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "description": "Labels across"
          },
          "rows": {
            "type": "integer",
            "minimum": 1,
            "maximum": 40,
            "description": "Labels down"
          },
          "marginTop": {
            "type": "number",
            "minimum": 0,
            "maximum": 300,
            "description": "Space above the first row, in millimetres"
          },
          "marginLeft": {
            "type": "number",
            "minimum": 0,
            "maximum": 300,
            "description": "Space left of the first column, in millimetres"
          },
          "gapX": {
            "type": "number",
            "minimum": 0,
            "maximum": 300,
            "description": "Space between columns, in millimetres"
          },
          "gapY": {
            "type": "number",
            "minimum": 0,
            "maximum": 300,
            "description": "Space between rows, in millimetres"
          }
        },
        "required": [
          "paper",
          "columns",
          "rows",
          "marginTop",
          "marginLeft",
          "gapX",
          "gapY"
        ],
        "additionalProperties": false,
        "description": "For labels on sheets, such as A4 sticker sheets: how they are laid out. Null for labels on a roll or tape, printed one at a time"
      },
      "LabelTemplate": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the template"
          },
          "name": {
            "type": "string",
            "description": "Display name, such as 'Asset label 62mm'"
          },
          "description": {
            "description": "What it's for, or null",
            "type": ["string", "null"]
          },
          "subject": {
            "type": "string",
            "enum": ["ASSET", "LOCATION"],
            "description": "Whether the labels are for assets or locations"
          },
          "width": {
            "type": "number",
            "description": "Width of one label, in millimetres"
          },
          "height": {
            "type": "number",
            "description": "Height of one label, in millimetres"
          },
          "sheet": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LabelSheet"
              },
              {
                "type": "null"
              }
            ]
          },
          "elements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelElement"
            },
            "description": "What's drawn on each label, from the bottom layer up"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the template was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the template last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "subject",
          "width",
          "height",
          "sheet",
          "elements",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "How a label looks: its size, whether it's on a sheet or a roll, and where the barcode, text, logo and colour bands go"
      },
      "AssetSettings": {
        "type": "object",
        "properties": {
          "idPrefix": {
            "type": "string",
            "description": "What new asset IDs start with, e.g. `A-` gives A-0001. May be empty"
          },
          "idPadLength": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many digits new asset IDs' numbers are padded to, e.g. 4 gives A-0001"
          },
          "idNextNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The number the next generated asset ID gets. Numbers already used are skipped"
          }
        },
        "required": ["idPrefix", "idPadLength", "idNextNumber"],
        "additionalProperties": false,
        "description": "How the organisation's new asset IDs are numbered"
      },
      "LocationBarcode": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the barcode record"
          },
          "value": {
            "type": "string",
            "description": "The barcode as printed or scanned"
          },
          "symbology": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "QR_CODE",
                  "CODE_128",
                  "CODE_39",
                  "CODE_93",
                  "EAN_8",
                  "EAN_13"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What it is printed as, or null if not known"
          },
          "notes": {
            "description": "Notes on the barcode",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was added"
          }
        },
        "required": ["uuid", "value", "symbology", "notes", "createdAt"],
        "additionalProperties": false,
        "description": "An extra barcode on a location. Every location also answers to its own UUID"
      },
      "ScannedAsset": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the asset"
          },
          "primaryID": {
            "type": "string",
            "description": "The asset's primary asset ID"
          },
          "assetTypeUUID": {
            "type": "string",
            "description": "UUID of its asset type"
          },
          "assetTypeName": {
            "type": "string",
            "description": "Name of its asset type"
          },
          "assetTypeThumbnailUUID": {
            "description": "UUID of the asset type's thumbnail, or null",
            "type": ["string", "null"]
          },
          "categoryUUID": {
            "type": "string",
            "description": "UUID of its category"
          },
          "tracking": {
            "type": "string",
            "enum": ["INDIVIDUAL", "BULK"],
            "description": "`INDIVIDUAL` for one unit, `BULK` for a lot"
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "1 for a unit; the items in a lot"
          },
          "storageLocationUUID": {
            "description": "UUID of the location it is kept at, or null",
            "type": ["string", "null"]
          },
          "storageLocationName": {
            "description": "Name of the location it is kept at, or null",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the case it is kept in, or null",
            "type": ["string", "null"]
          },
          "parentPrimaryID": {
            "description": "Primary asset ID of the case it is kept in, or null",
            "type": ["string", "null"]
          },
          "archived": {
            "type": "boolean",
            "description": "The asset is archived"
          }
        },
        "required": [
          "uuid",
          "primaryID",
          "assetTypeUUID",
          "assetTypeName",
          "assetTypeThumbnailUUID",
          "categoryUUID",
          "tracking",
          "quantity",
          "storageLocationUUID",
          "storageLocationName",
          "parentUUID",
          "parentPrimaryID",
          "archived"
        ],
        "additionalProperties": false,
        "description": "The parts of an asset the scanner shows"
      },
      "ScanTarget": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": ["LOCATION", "CASE", "STOCK_CHECK", "NONE", "PROJECT"],
            "description": "`LOCATION`, `CASE` (scanning into an asset such as a flight case), `STOCK_CHECK` (checking a location against what should be there), `NONE` (just recording sightings) or `PROJECT` (prepping, sending out or checking back a project's assets)"
          },
          "location": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the location"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the location"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The location, for LOCATION and STOCK_CHECK"
          },
          "locationPath": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the location"
                },
                "name": {
                  "type": "string",
                  "description": "Name of the location"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "The locations the target location is inside, outermost first"
          },
          "case": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScannedAsset"
              },
              {
                "type": "null"
              }
            ],
            "description": "The case, for CASE"
          },
          "project": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the project"
                  },
                  "number": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "The project's number"
                  },
                  "name": {
                    "type": "string",
                    "description": "The project's name"
                  },
                  "stage": {
                    "type": "string",
                    "enum": ["PREP", "DISPATCH", "RETURN"],
                    "description": "`PREP` (picking it), `DISPATCH` (sending it out) or `RETURN` (checking it back in)"
                  }
                },
                "required": ["uuid", "number", "name", "stage"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The project, for PROJECT"
          }
        },
        "required": ["kind", "location", "locationPath", "case", "project"],
        "additionalProperties": false,
        "description": "What a scan session scans into"
      },
      "ScanSession": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the session"
          },
          "target": {
            "$ref": "#/components/schemas/ScanTarget"
          },
          "mode": {
            "type": "string",
            "enum": ["RECORD", "MOVE"],
            "description": "`RECORD` only records where assets were seen. `MOVE` also sets each asset's storage location (and takes it out of any case) or puts it in the case"
          },
          "includeSubLocations": {
            "type": "boolean",
            "description": "Stock checks only: assets stored in locations inside the target are expected too"
          },
          "targetVerified": {
            "type": "boolean",
            "description": "The target was proved by scanning its barcode, rather than picked from a list"
          },
          "filming": {
            "type": "boolean",
            "description": "Scans in this session are filmed, where the device can"
          },
          "photosRequired": {
            "type": "boolean",
            "description": "Every scan in this session needs a condition photo"
          },
          "inspectionTemplate": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the template"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the template"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Each asset scanned is inspected with this template, such as PAT testing a batch, or null"
          },
          "startedByUserUuid": {
            "description": "UUID of the member who started it",
            "type": ["string", "null"]
          },
          "scanCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many scans were recorded"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it started"
          },
          "endedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was ended, or null while it is open"
          }
        },
        "required": [
          "uuid",
          "target",
          "mode",
          "includeSubLocations",
          "targetVerified",
          "filming",
          "photosRequired",
          "inspectionTemplate",
          "startedByUserUuid",
          "scanCount",
          "startedAt",
          "endedAt"
        ],
        "additionalProperties": false,
        "description": "A run of the scanner, with what it scans into"
      },
      "ScanPhoto": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the photo"
          },
          "fileUUID": {
            "type": "string",
            "description": "UUID of the image file, at /{locale}/org/{organisationSlug}/files/view/{fileUUID}"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was taken"
          }
        },
        "required": ["uuid", "fileUUID", "createdAt"],
        "additionalProperties": false,
        "description": "A condition photo taken with a scan"
      },
      "Scan": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the scan"
          },
          "sessionUUID": {
            "description": "UUID of the session it was made in, or null if it was imported from the previous version of AdamRMS",
            "type": ["string", "null"]
          },
          "asset": {
            "$ref": "#/components/schemas/ScannedAsset"
          },
          "value": {
            "type": "string",
            "description": "What was read or typed"
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many were seen: 1 for a unit, up to the lot's size"
          },
          "method": {
            "type": "string",
            "enum": ["CAMERA", "SCANNER", "TYPED", "SCANNED"],
            "description": "`CAMERA`, `SCANNER` (a handheld or Bluetooth scanner), `TYPED`, or `SCANNED` for an imported scan where the device isn't known"
          },
          "location": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the location"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the location"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Where it was seen, or null"
          },
          "case": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the case"
                  },
                  "primaryID": {
                    "type": "string",
                    "description": "Primary asset ID of the case"
                  }
                },
                "required": ["uuid", "primaryID"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The case it was scanned into, or null"
          },
          "customLocation": {
            "description": "A location typed as text in the previous version of AdamRMS",
            "type": ["string", "null"]
          },
          "locationVerified": {
            "type": "boolean",
            "description": "The location was proved by scanning its barcode in the same session"
          },
          "moved": {
            "type": "boolean",
            "description": "The scan changed the asset's location or case"
          },
          "latitude": {
            "description": "Device latitude, or null",
            "type": ["number", "null"]
          },
          "longitude": {
            "description": "Device longitude, or null",
            "type": ["number", "null"]
          },
          "accuracyMetres": {
            "description": "How accurate the position was, in metres, or null",
            "type": ["number", "null"]
          },
          "condition": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["GOOD", "WORN", "DAMAGED"]
              },
              {
                "type": "null"
              }
            ],
            "description": "`GOOD`, `WORN` or `DAMAGED`, or null if not rated"
          },
          "conditionNote": {
            "description": "A note on its condition",
            "type": ["string", "null"]
          },
          "photos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanPhoto"
            },
            "description": "Condition photos"
          },
          "videoFileUUID": {
            "description": "UUID of the footage of the scan, or null if there is none or it has expired",
            "type": ["string", "null"]
          },
          "videoExpiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the footage will be deleted, or null to keep it forever"
          },
          "scannedByUserUuid": {
            "description": "UUID of the member who scanned it",
            "type": ["string", "null"]
          },
          "scannedByName": {
            "description": "Name of the member who scanned it, or null if not known",
            "type": ["string", "null"]
          },
          "scannedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was scanned"
          }
        },
        "required": [
          "uuid",
          "sessionUUID",
          "asset",
          "value",
          "quantity",
          "method",
          "location",
          "case",
          "customLocation",
          "locationVerified",
          "moved",
          "latitude",
          "longitude",
          "accuracyMetres",
          "condition",
          "conditionNote",
          "photos",
          "videoFileUUID",
          "videoExpiresAt",
          "scannedByUserUuid",
          "scannedByName",
          "scannedAt"
        ],
        "additionalProperties": false,
        "description": "A sighting of an asset"
      },
      "ScanSettings": {
        "type": "object",
        "properties": {
          "filming": {
            "type": "string",
            "enum": ["OFF", "DEFAULT_ON", "REQUIRED"],
            "description": "Filming scans: `OFF` (off unless turned on), `DEFAULT_ON` (on unless turned off) or `REQUIRED`"
          },
          "photos": {
            "type": "string",
            "enum": ["OFF", "DEFAULT_ON", "REQUIRED"],
            "description": "Condition photos with every scan: `OFF`, `DEFAULT_ON` or `REQUIRED`"
          },
          "footageRetentionDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many days footage is kept for, or 0 to keep it forever"
          }
        },
        "required": ["filming", "photos", "footageRetentionDays"],
        "additionalProperties": false,
        "description": "How the organisation's scanner films and photographs scans"
      },
      "ScanPreset": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the preset"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "targetKind": {
            "type": "string",
            "enum": ["LOCATION", "CASE", "STOCK_CHECK", "NONE", "PROJECT"],
            "description": "What it scans into"
          },
          "locationUUID": {
            "description": "UUID of the target location, or null",
            "type": ["string", "null"]
          },
          "locationName": {
            "description": "Name of the target location, or null",
            "type": ["string", "null"]
          },
          "caseUUID": {
            "description": "UUID of the target case, or null",
            "type": ["string", "null"]
          },
          "casePrimaryID": {
            "description": "Primary asset ID of the target case, or null",
            "type": ["string", "null"]
          },
          "mode": {
            "type": "string",
            "enum": ["RECORD", "MOVE"],
            "description": "`RECORD` or `MOVE`"
          },
          "includeSubLocations": {
            "type": "boolean",
            "description": "Stock checks only: include locations inside the target"
          },
          "filming": {
            "type": "boolean",
            "description": "Film scans"
          },
          "photosRequired": {
            "type": "boolean",
            "description": "Require a condition photo"
          },
          "inspectionTemplate": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the template"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the template"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Each asset scanned is inspected with this template, such as PAT testing a batch, or null"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was saved"
          }
        },
        "required": [
          "uuid",
          "name",
          "targetKind",
          "locationUUID",
          "locationName",
          "caseUUID",
          "casePrimaryID",
          "mode",
          "includeSubLocations",
          "filming",
          "photosRequired",
          "inspectionTemplate",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "A saved way to start the scanner"
      },
      "LocalisationSettings": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "GBP",
              "USD",
              "EUR",
              "AUD",
              "CAD",
              "CHF",
              "CNY",
              "JPY",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BGN",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BYN",
              "BZD",
              "CDF",
              "CLP",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLE",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XCG",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "description": "ISO 4217 code of the currency the organisation hires in, e.g. `GBP`. Rates and values are stored in its smallest unit (pence, cents)"
          },
          "timezone": {
            "type": "string",
            "description": "IANA name of the organisation's timezone, e.g. `Europe/London`. Dates on projects and documents are in this timezone"
          },
          "documentLanguage": {
            "type": "string",
            "enum": ["en", "fr", "es", "de", "it", "pt", "nl"],
            "description": "Language of documents written for clients, such as quotes and invoices: one of `en`, `fr`, `es`, `de`, `it`, `pt`, `nl`"
          },
          "unitSystem": {
            "type": "string",
            "enum": ["METRIC", "IMPERIAL_UK", "IMPERIAL_US"],
            "description": "How masses are shown: `METRIC` (g, kg, t), `IMPERIAL_UK` (oz, lb, 2,240 lb ton) or `IMPERIAL_US` (oz, lb, 2,000 lb ton)"
          }
        },
        "required": ["currency", "timezone", "documentLanguage", "unitSystem"],
        "additionalProperties": false,
        "description": "The organisation's currency, timezone, language and units"
      },
      "LocalisationSettingsWithLock": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "GBP",
              "USD",
              "EUR",
              "AUD",
              "CAD",
              "CHF",
              "CNY",
              "JPY",
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "ARS",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BGN",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BWP",
              "BYN",
              "BZD",
              "CDF",
              "CLP",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ETB",
              "FJD",
              "FKP",
              "GEL",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLE",
              "SOS",
              "SRD",
              "STD",
              "SZL",
              "THB",
              "TJS",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "UYU",
              "UZS",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XCG",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "description": "ISO 4217 code of the currency the organisation hires in, e.g. `GBP`. Rates and values are stored in its smallest unit (pence, cents)"
          },
          "timezone": {
            "type": "string",
            "description": "IANA name of the organisation's timezone, e.g. `Europe/London`. Dates on projects and documents are in this timezone"
          },
          "documentLanguage": {
            "type": "string",
            "enum": ["en", "fr", "es", "de", "it", "pt", "nl"],
            "description": "Language of documents written for clients, such as quotes and invoices: one of `en`, `fr`, `es`, `de`, `it`, `pt`, `nl`"
          },
          "unitSystem": {
            "type": "string",
            "enum": ["METRIC", "IMPERIAL_UK", "IMPERIAL_US"],
            "description": "How masses are shown: `METRIC` (g, kg, t), `IMPERIAL_UK` (oz, lb, 2,240 lb ton) or `IMPERIAL_US` (oz, lb, 2,000 lb ton)"
          },
          "currencyLocked": {
            "type": "boolean",
            "description": "Whether the currency can no longer change, because projects have prices, quotes, invoices or payments in it"
          }
        },
        "required": [
          "currency",
          "timezone",
          "documentLanguage",
          "unitSystem",
          "currencyLocked"
        ],
        "additionalProperties": false,
        "description": "The organisation's currency, timezone, language and units, and whether the currency can still change"
      },
      "SecuritySettings": {
        "type": "object",
        "properties": {
          "idleTimeoutMinutes": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 15
                  },
                  {
                    "type": "number",
                    "const": 30
                  },
                  {
                    "type": "number",
                    "const": 60
                  },
                  {
                    "type": "number",
                    "const": 120
                  },
                  {
                    "type": "number",
                    "const": 240
                  },
                  {
                    "type": "number",
                    "const": 480
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Sign members out after this many minutes without using the organisation, such as on a shared warehouse computer: one of 15, 30, 60, 120, 240, 480, or null for never. Using the dashboard or another organisation doesn't count as using this one"
          },
          "mfaRequiredRoleUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the roles whose members must use two-factor authentication. Members with these roles who haven't set it up can't use the organisation until they do. Empty for none"
          }
        },
        "required": ["idleTimeoutMinutes", "mfaRequiredRoleUUIDs"],
        "additionalProperties": false,
        "description": "Which roles must use two-factor authentication, and when idle members are signed out"
      },
      "AuditEvent": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the event"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it happened"
          },
          "actorUserUuid": {
            "description": "User UUID of whoever did it, or null for AdamRMS itself",
            "type": ["string", "null"]
          },
          "actorDisplay": {
            "description": "Name of whoever did it, as it was at the time",
            "type": ["string", "null"]
          },
          "actorType": {
            "type": "string",
            "description": "What did it, such as `USER`, `APP` or `SYSTEM`"
          },
          "impersonatorDisplay": {
            "description": "Set when AdamRMS support acted as the member: who from AdamRMS support",
            "type": ["string", "null"]
          },
          "action": {
            "type": "string",
            "description": "What happened, such as `organisation.asset.updated`"
          },
          "outcome": {
            "type": "string",
            "description": "`SUCCESS`, or `DENIED` for something that was refused"
          },
          "severity": {
            "type": "string",
            "description": "How serious the event is"
          },
          "reportableEntityType": {
            "type": "string",
            "description": "The kind of record the event is about"
          },
          "detailShort": {
            "type": "string",
            "description": "One-line summary"
          },
          "detailFull": {
            "type": "string",
            "description": "Full description"
          },
          "changedFields": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string",
                      "description": "Field name"
                    },
                    "before": {
                      "description": "Value before",
                      "type": ["string", "null"]
                    },
                    "after": {
                      "description": "Value after",
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["field", "before", "after"],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "The fields a change changed, with their values before and after. Secrets are never recorded"
          }
        },
        "required": [
          "uuid",
          "occurredAt",
          "actorUserUuid",
          "actorDisplay",
          "actorType",
          "impersonatorDisplay",
          "action",
          "outcome",
          "severity",
          "reportableEntityType",
          "detailShort",
          "detailFull",
          "changedFields"
        ],
        "additionalProperties": false,
        "description": "One entry in the organisation's audit log"
      },
      "PublicSiteSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether the public site is on. While it's off, every public page says it isn't available"
          },
          "introduction": {
            "description": "A few sentences shown at the top of the public site, such as what you hire out and where",
            "type": ["string", "null"]
          },
          "catalogue": {
            "type": "boolean",
            "description": "Show a catalogue of the asset types you hire out, for visitors to browse"
          },
          "showPrices": {
            "type": "boolean",
            "description": "Show each asset type's hire rate in the catalogue"
          },
          "categoryUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the categories the catalogue shows, with their subcategories. Empty for every category"
          },
          "packages": {
            "type": "boolean",
            "description": "Show packages in the catalogue too, with what's in each. Only packages set to show on the public site are listed"
          },
          "enquiries": {
            "type": "boolean",
            "description": "Let visitors send an enquiry from the catalogue. Each one becomes a new project"
          },
          "enquiryStatusUUID": {
            "description": "UUID of the status enquiry projects get, or null for the first status at the provisional stage",
            "type": ["string", "null"]
          },
          "enquiryManagerUUID": {
            "description": "UUID of the member who manages enquiry projects and is emailed about each one, or null for nobody",
            "type": ["string", "null"]
          },
          "vacancies": {
            "type": "boolean",
            "description": "Show the crew vacancies you've chosen to advertise publicly"
          },
          "vacancyClients": {
            "type": "boolean",
            "description": "Show the client of each vacancy's project"
          },
          "colourScheme": {
            "type": "string",
            "enum": ["AUTO", "LIGHT", "DARK"],
            "description": "`AUTO` follows each visitor's light or dark setting. `LIGHT` or `DARK` always uses that one, such as to match your own website"
          },
          "accentColour": {
            "description": "Colour of buttons and links, as a hex colour such as #1864ab, or null for AdamRMS pink",
            "type": ["string", "null"]
          },
          "frameHeader": {
            "type": "boolean",
            "description": "Show your logo and name at the top when the public site is in a frame on your own website. It's always shown on its own page"
          }
        },
        "required": [
          "enabled",
          "introduction",
          "catalogue",
          "showPrices",
          "categoryUUIDs",
          "packages",
          "enquiries",
          "enquiryStatusUUID",
          "enquiryManagerUUID",
          "vacancies",
          "vacancyClients",
          "colourScheme",
          "accentColour",
          "frameHeader"
        ],
        "additionalProperties": false,
        "description": "What the organisation's public site shows"
      },
      "SearchResult": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "asset-type",
              "asset",
              "project",
              "client",
              "location",
              "wiki-page",
              "member"
            ],
            "description": "What the record is. Apart from `member`, its key is also the record type used for comments and files"
          },
          "uuid": {
            "type": "string",
            "description": "The record's UUID"
          },
          "title": {
            "type": "string",
            "description": "The record's name. For an asset, its primary tag (or another identifier if it has no primary one)"
          },
          "number": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The project's number, or null for other kinds"
          },
          "detail": {
            "description": "For an asset, the name of its asset type. For a member, their job title. Null otherwise",
            "type": ["string", "null"]
          },
          "snippet": {
            "description": "A short extract of the record's text around what matched, such as a client's notes or a wiki page's content. Null if it has none",
            "type": ["string", "null"]
          },
          "archived": {
            "type": "boolean",
            "description": "Whether the record is archived"
          }
        },
        "required": [
          "kind",
          "uuid",
          "title",
          "number",
          "detail",
          "snippet",
          "archived"
        ],
        "additionalProperties": false
      },
      "OrganisationDetails": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The organisation's name, shown to members and on documents for clients"
          },
          "supportContactInfo": {
            "description": "Who members should contact for help, shown when they lack a permission or a licence. Null for none",
            "type": ["string", "null"]
          },
          "address": {
            "description": "Postal address, printed on documents for clients such as quotes and invoices. Null for none",
            "type": ["string", "null"]
          },
          "phone": {
            "description": "Phone number for clients. Null for none",
            "type": ["string", "null"]
          },
          "email": {
            "description": "Email address for clients. Null for none",
            "type": ["string", "null"]
          },
          "website": {
            "description": "Website address, such as `https://example.com`. Null for none",
            "type": ["string", "null"]
          },
          "taxIdLabel": {
            "description": "What the organisation's tax registration is called where it trades, such as 'VAT number', 'GST number' or 'ABN'. Printed on documents for clients. Null if not set",
            "type": ["string", "null"]
          },
          "taxId": {
            "description": "The tax registration number. Null for none",
            "type": ["string", "null"]
          },
          "companyIdLabel": {
            "description": "What the organisation's company registration is called, such as 'Company number' or 'ACN'. Printed on documents for clients. Null if not set",
            "type": ["string", "null"]
          },
          "companyId": {
            "description": "The company registration number. Null for none",
            "type": ["string", "null"]
          },
          "hasEmailHeader": {
            "type": "boolean",
            "description": "Whether the organisation has an email header: the image at the top of emails sent about it"
          },
          "hasLogo": {
            "type": "boolean",
            "description": "Whether the organisation has a logo: shown in the navigation, on documents for clients and on labels"
          }
        },
        "required": [
          "name",
          "supportContactInfo",
          "address",
          "phone",
          "email",
          "website",
          "taxIdLabel",
          "taxId",
          "companyIdLabel",
          "companyId",
          "hasEmailHeader",
          "hasLogo"
        ],
        "additionalProperties": false,
        "description": "The organisation's name and contact details"
      },
      "PriceStructure": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the price structure"
          },
          "name": {
            "type": "string",
            "description": "Display name, e.g. '3-day week'"
          },
          "description": {
            "description": "What the structure is for, or null",
            "type": ["string", "null"]
          },
          "unit": {
            "type": "string",
            "enum": ["HOUR", "DAY", "WEEK", "MONTH", "NONE"],
            "description": "What one unit of an item's rate pays for: `HOUR`, `DAY`, `WEEK`, `MONTH`, or `NONE` (charged once per project however long it is, also used for sales of consumables)"
          },
          "factors": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "Cumulative multipliers of the rate for 1, 2, 3... units: the total charged for that many units, not the extra for each. E.g. `[1, 2, 3, 3, 3, 3, 3]` is a 3-day week: 3 days cost 3x the day rate, and 4 to 7 days cost the same"
          },
          "beyond": {
            "type": "string",
            "enum": ["REPEAT", "EXTEND", "HOLD"],
            "description": "What happens after the last factor: `REPEAT` (start the table again, adding to the total so far - a weekly table charges every week the same), `EXTEND` (add `extendFactor` for each extra unit) or `HOLD` (stay at the last factor)"
          },
          "extendFactor": {
            "type": "number",
            "description": "With `beyond: EXTEND`, the multiplier of the rate added for each unit after the last factor, e.g. 1 to charge every extra day in full, 0.5 for half price"
          },
          "minimumUnits": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "A hire shorter than this many units is charged as this many, e.g. 4 for a four-hour minimum"
          },
          "dayCounting": {
            "type": "string",
            "enum": ["CALENDAR", "ELAPSED"],
            "description": "How days are counted from a hire's dates: `CALENDAR` (every calendar day it touches, start and end included) or `ELAPSED` (every started 24 hours, after `leewayMinutes`)"
          },
          "leewayMinutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "With `ELAPSED` counting (and for hourly structures), how many minutes a hire can overrun before another unit is charged"
          },
          "chargeableWeekdays": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
            },
            "description": "The weekdays that are charged with `CALENDAR` counting, e.g. Monday to Friday for a five-day week. Defaults to every day"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the organisation's default structure, used for items that don't choose one. Exactly one structure is the default"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the structure was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the structure last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "unit",
          "factors",
          "beyond",
          "extendFactor",
          "minimumUnits",
          "dayCounting",
          "leewayMinutes",
          "chargeableWeekdays",
          "isDefault",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A price structure: how the length of a hire becomes a multiple of an item's rate"
      },
      "TaxRate": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the tax rate"
          },
          "name": {
            "type": "string",
            "description": "Display name, for example 'Standard'"
          },
          "rateBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The rate in basis points: 2000 is 20%. 0 unless `STANDARD`"
          },
          "kind": {
            "type": "string",
            "enum": ["STANDARD", "ZERO", "EXEMPT", "REVERSE_CHARGE"],
            "description": "`STANDARD` (a percentage), `ZERO` (zero-rated), `EXEMPT` (no tax applies) or `REVERSE_CHARGE` (the client accounts for the tax)"
          },
          "code": {
            "description": "Its code in accounting software, such as Xero's 'OUTPUT2', or null",
            "type": ["string", "null"]
          },
          "isDefault": {
            "type": "boolean",
            "description": "Anything with no rate of its own is taxed at this one"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position in the list, 0-based"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the rate was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the rate last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "rateBp",
          "kind",
          "code",
          "isDefault",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A tax rate"
      },
      "TaxSettings": {
        "type": "object",
        "properties": {
          "taxName": {
            "type": "string",
            "description": "What tax is called on documents, such as 'VAT', 'GST' or 'Sales tax'"
          }
        },
        "required": ["taxName"],
        "additionalProperties": false,
        "description": "Tax settings"
      },
      "Service": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the service"
          },
          "name": {
            "type": "string",
            "description": "Display name, such as 'Delivery' or 'Technician day'"
          },
          "description": {
            "description": "What the service is, shown on quotes, or null",
            "type": ["string", "null"]
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Rate of one in the smallest currency unit (such as pence). How a project's length multiplies it is set by the price structure. Null if it's priced on each project"
          },
          "priceStructureUUID": {
            "description": "UUID of the price structure that sets how the length of a project multiplies the rate. Null for the organisation's default",
            "type": ["string", "null"]
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate it's charged at. Null for the organisation's default rate",
            "type": ["string", "null"]
          },
          "cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "What one costs the organisation, in the smallest currency unit, for working out margin, or null"
          },
          "certificationTypes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the certification type"
                },
                "name": {
                  "type": "string",
                  "description": "The certification type's name"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "Certifications crew charged as it need, such as IPAF for a rigger. Empty for none"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the service was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the service last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "rate",
          "priceStructureUUID",
          "taxRateUUID",
          "cost",
          "certificationTypes",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Something the organisation charges for that isn't stock, such as delivery or a technician day"
      },
      "CrewRole": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the crew role"
          },
          "name": {
            "type": "string",
            "description": "The role, such as 'Lighting designer' or 'Sound No.1'"
          },
          "description": {
            "description": "What the role involves, with links to more about it, in Markdown. Shown on every vacancy for it, or null",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the crew role was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the crew role last changed"
          }
        },
        "required": ["uuid", "name", "description", "createdAt", "updatedAt"],
        "additionalProperties": false,
        "description": "A role the organisation recruits crew for again and again, such as a lighting designer, with what it involves"
      },
      "ProjectTemplateLine": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": ["ASSET_TYPE", "PACKAGE", "SERVICE", "CHARGE"],
            "description": "ASSET_TYPE (some of an asset type, with its accessories), PACKAGE (a package, with its contents), SERVICE or CHARGE (a one-off line)"
          },
          "itemUUID": {
            "description": "UUID of the asset type, package or service. Null for a charge",
            "type": ["string", "null"]
          },
          "description": {
            "type": "string",
            "description": "What the line shows as: the item's name, or a charge's own text"
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many"
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "A charge's rate of one, in the smallest currency unit. Null for catalogue items, which are priced when the project is started"
          },
          "cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "A charge's cost of one, or null"
          },
          "comment": {
            "description": "A note on the line, or null",
            "type": ["string", "null"]
          },
          "available": {
            "type": "boolean",
            "description": "False if the item has been deleted since: the line is left out of new projects"
          }
        },
        "required": [
          "kind",
          "itemUUID",
          "description",
          "quantity",
          "rate",
          "cost",
          "comment",
          "available"
        ],
        "additionalProperties": false,
        "description": "A line the template adds to a project"
      },
      "ProjectTemplate": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the template"
          },
          "name": {
            "type": "string",
            "description": "The template's name, such as 'Wedding: small PA and lighting'"
          },
          "description": {
            "description": "What the template is for, shown when choosing one, or null",
            "type": ["string", "null"]
          },
          "type": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the project type"
                  },
                  "name": {
                    "type": "string",
                    "description": "The type's name"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The type projects started from it get unless another is chosen, or null for the default type"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectTemplateLine"
            },
            "description": "The lines it adds, in quote order"
          },
          "crewRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "description": "The role, such as 'Stage crew'"
                },
                "count": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many people it needs"
                }
              },
              "required": ["role", "count"],
              "additionalProperties": false
            },
            "description": "Crew roles it needs. Each becomes a vacancy on the new project, not yet taking applications"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "The note's title"
                },
                "body": {
                  "type": "string",
                  "description": "The note, in Markdown"
                }
              },
              "required": ["title", "body"],
              "additionalProperties": false
            },
            "description": "Notes it copies onto the new project"
          },
          "currency": {
            "type": "string",
            "description": "The organisation's currency, which charges' rates are in"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the template was saved"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the template last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "type",
          "lines",
          "crewRoles",
          "notes",
          "currency",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A project saved to start others from: its lines, crew roles and notes"
      },
      "ProjectAllocation": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the allocation"
          },
          "assetUUID": {
            "type": "string",
            "description": "UUID of the asset"
          },
          "assetId": {
            "description": "The asset's primary asset ID, such as its barcode, or null",
            "type": ["string", "null"]
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many: 1 for an individual unit, some of a lot for bulk"
          },
          "linkedFromAllocationUUID": {
            "description": "The allocation of the case it came with, or null if it was allocated itself",
            "type": ["string", "null"]
          },
          "preppedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was prepped, or null"
          },
          "dispatchedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it went out, or null"
          },
          "returnedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it came back, or null"
          },
          "returnedQuantity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "How many of a lot came back, or null"
          },
          "missingQuantity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "How many of a lot are missing, or null"
          }
        },
        "required": [
          "uuid",
          "assetUUID",
          "assetId",
          "quantity",
          "linkedFromAllocationUUID",
          "preppedAt",
          "dispatchedAt",
          "returnedAt",
          "returnedQuantity",
          "missingQuantity"
        ],
        "additionalProperties": false,
        "description": "Stock allocated to a line: a unit, or some of a lot"
      },
      "SubHire": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the sub-hire"
          },
          "supplierClientUUID": {
            "description": "UUID of the supplier, a client, or null",
            "type": ["string", "null"]
          },
          "supplierClientName": {
            "description": "The supplier client's name, or null",
            "type": ["string", "null"]
          },
          "supplierName": {
            "description": "The supplier's name when it isn't a client, or null",
            "type": ["string", "null"]
          },
          "reference": {
            "description": "The supplier's reference, such as their order number",
            "type": ["string", "null"]
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many are hired in. They count as stock for this line only"
          },
          "cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "What the whole sub-hire costs, in the smallest currency unit. Null if unknown, or if you can't see prices"
          },
          "start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it arrives, or null"
          },
          "end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it goes back, or null"
          }
        },
        "required": [
          "uuid",
          "supplierClientUUID",
          "supplierClientName",
          "supplierName",
          "reference",
          "quantity",
          "cost",
          "start",
          "end"
        ],
        "additionalProperties": false,
        "description": "Stock hired in from a supplier to fill a line"
      },
      "ProjectLinePrices": {
        "type": "object",
        "properties": {
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The rate of one, in the smallest currency unit, as copied when it was priced. Null if it has none"
          },
          "priceStructureName": {
            "description": "The price structure it was priced with, or null for a one-off price",
            "type": ["string", "null"]
          },
          "clientPricingName": {
            "description": "The client pricing it was priced through, or null",
            "type": ["string", "null"]
          },
          "units": {
            "type": "number",
            "description": "Chargeable units, such as days, worked out from the dates or set on the line"
          },
          "unitsOverride": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Chargeable units set on this line, or null to work them out"
          },
          "discountBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Discount in basis points: 1000 is 10%"
          },
          "customPrice": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "A price for the whole line that replaces the calculated one, or null"
          },
          "hirePrice": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Rate × units × quantity, before discount"
          },
          "lineTotal": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What the line charges, after discount, before tax"
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate, or null when no tax applies",
            "type": ["string", "null"]
          },
          "taxRateBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The tax rate it was priced at, in basis points"
          },
          "lineTax": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Tax on the line total"
          },
          "cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "What one costs the organisation, or null"
          }
        },
        "required": [
          "rate",
          "priceStructureName",
          "clientPricingName",
          "units",
          "unitsOverride",
          "discountBp",
          "customPrice",
          "hirePrice",
          "lineTotal",
          "taxRateUUID",
          "taxRateBp",
          "lineTax",
          "cost"
        ],
        "additionalProperties": false,
        "description": "A line's prices, all in the smallest currency unit"
      },
      "ProjectLineAvailability": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Stock of the asset type"
          },
          "booked": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "On other confirmed projects over the line's period"
          },
          "held": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "On other provisional projects over the line's period. Not taken away"
          },
          "blocked": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Can't be booked because of maintenance or an overdue inspection"
          },
          "available": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's left for this line, after other projects and the lines above it on this project"
          },
          "shortage": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many more the line needs than are available. 0 when there are enough, or the project has no dates"
          }
        },
        "required": [
          "total",
          "booked",
          "held",
          "blocked",
          "available",
          "shortage"
        ],
        "additionalProperties": false,
        "description": "How much of a line's asset type is free over its period"
      },
      "ProjectLine": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the line"
          },
          "projectUUID": {
            "type": "string",
            "description": "UUID of the project or sub-project it's on"
          },
          "parentLineUUID": {
            "description": "The line it goes out with: an accessory's asset type, a package's contents or a case's contents. Null at the top",
            "type": ["string", "null"]
          },
          "kind": {
            "type": "string",
            "enum": [
              "ASSET_TYPE",
              "PACKAGE",
              "PACKAGE_CONTENT",
              "ACCESSORY",
              "SERVICE",
              "CHARGE",
              "SUB_HIRE"
            ],
            "description": "ASSET_TYPE (some of an asset type, such as 12 LED pars), PACKAGE (a package at its own price), PACKAGE_CONTENT (an asset type in a package, under it), ACCESSORY (an accessory, under the asset type it goes out with), SERVICE (a service, such as delivery), CHARGE (a one-off line) or SUB_HIRE (stock hired in from a supplier)"
          },
          "assetTypeUUID": {
            "description": "Its asset type, or null",
            "type": ["string", "null"]
          },
          "packageUUID": {
            "description": "Its package, or null",
            "type": ["string", "null"]
          },
          "serviceUUID": {
            "description": "Its service, or null",
            "type": ["string", "null"]
          },
          "description": {
            "type": "string",
            "description": "What it is, as it shows on the quote"
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position among the lines next to it, from 0"
          },
          "comment": {
            "description": "A note on the line, or null",
            "type": ["string", "null"]
          },
          "charged": {
            "type": "boolean",
            "description": "False when it goes out free, as accessories and package contents do unless charged"
          },
          "start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When this line alone goes out, or null for the project's dates"
          },
          "end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When this line alone comes back, or null for the project's dates"
          },
          "prices": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectLinePrices"
              },
              {
                "type": "null"
              }
            ],
            "description": "The line's prices, or null if you can't see prices"
          },
          "allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectAllocation"
            },
            "description": "The assets allocated to it"
          },
          "subHires": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubHire"
            },
            "description": "What's hired in to fill it"
          },
          "availability": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectLineAvailability"
              },
              {
                "type": "null"
              }
            ],
            "description": "How much of its asset type is free, or null if it takes no stock"
          }
        },
        "required": [
          "uuid",
          "projectUUID",
          "parentLineUUID",
          "kind",
          "assetTypeUUID",
          "packageUUID",
          "serviceUUID",
          "description",
          "quantity",
          "sortOrder",
          "comment",
          "charged",
          "start",
          "end",
          "prices",
          "allocations",
          "subHires",
          "availability"
        ],
        "additionalProperties": false,
        "description": "One line on a project's quote"
      },
      "TaxTotal": {
        "type": "object",
        "properties": {
          "taxRateUUID": {
            "description": "UUID of the tax rate, or null for lines with no tax",
            "type": ["string", "null"]
          },
          "name": {
            "type": "string",
            "description": "The rate's name, or empty for lines with no tax"
          },
          "rateBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The rate in basis points"
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Net of the lines at this rate"
          },
          "tax": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Tax at this rate"
          }
        },
        "required": ["taxRateUUID", "name", "rateBp", "net", "tax"],
        "additionalProperties": false,
        "description": "One tax rate's share of a project's total"
      },
      "ProjectTotals": {
        "type": "object",
        "properties": {
          "hireSubtotal": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What the charged lines come to before discounts"
          },
          "discounts": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Discounts and custom prices, as one amount taken off"
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total before tax"
          },
          "tax": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total tax"
          },
          "gross": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total with tax"
          },
          "taxByRate": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxTotal"
            },
            "description": "Tax for each rate"
          },
          "cost": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What it costs the organisation, including sub-hire"
          },
          "value": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Replacement value of the stock on it"
          },
          "massMg": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Mass of the stock on it, in milligrams"
          }
        },
        "required": [
          "hireSubtotal",
          "discounts",
          "net",
          "tax",
          "gross",
          "taxByRate",
          "cost",
          "value",
          "massMg"
        ],
        "additionalProperties": false,
        "description": "A project's totals, including its sub-projects, all in the smallest currency unit"
      },
      "ProjectLineGroup": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Identifies the group, to pass back in `groups`"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ALL",
              "CATEGORY",
              "NO_CATEGORY",
              "PACKAGES",
              "SERVICES",
              "PROJECT"
            ],
            "description": "ALL (every line), CATEGORY (one asset category), NO_CATEGORY (asset types with no category), PACKAGES, SERVICES (services, charges and sub-hire) or PROJECT (one project or sub-project)"
          },
          "name": {
            "description": "The category's or project's name. Null for the other kinds",
            "type": ["string", "null"]
          },
          "recordUUID": {
            "description": "UUID of the category or project, or null",
            "type": ["string", "null"]
          },
          "lines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Top-level lines in the group"
          },
          "matching": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Top-level lines that match the search and filter, or have a line under them that does. The same as `lines` without either"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "What the group's charged lines come to before tax, or null if you can't see prices"
          },
          "shortLines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Lines that need more than is free"
          },
          "toAllocateLines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Lines that need more assets allocated"
          },
          "subHireLines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Lines with stock hired in"
          },
          "lineUUIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the group's top-level lines that are in `lines`, in quote order. Empty for a group not asked for"
          }
        },
        "required": [
          "key",
          "kind",
          "name",
          "recordUUID",
          "lines",
          "matching",
          "total",
          "shortLines",
          "toAllocateLines",
          "subHireLines",
          "lineUUIDs"
        ],
        "additionalProperties": false,
        "description": "A group of a project's lines, such as one asset category"
      },
      "ProjectLineCounts": {
        "type": "object",
        "properties": {
          "lines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Top-level lines"
          },
          "needed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Assets the lines need from the organisation's own stock, after what's hired in"
          },
          "allocated": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Of those, how many are allocated"
          },
          "prepped": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Allocated assets prepped"
          },
          "dispatched": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Allocated assets sent out"
          },
          "returned": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Allocated assets back"
          },
          "shortLines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Lines that need more than is free"
          },
          "shortBy": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many more those lines need than are free"
          },
          "toAllocateLines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Lines that need more assets allocated"
          },
          "toAllocate": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many more assets need allocating"
          },
          "subHireLines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Lines with stock hired in"
          }
        },
        "required": [
          "lines",
          "needed",
          "allocated",
          "prepped",
          "dispatched",
          "returned",
          "shortLines",
          "shortBy",
          "toAllocateLines",
          "toAllocate",
          "subHireLines"
        ],
        "additionalProperties": false,
        "description": "How far a project's assets have got, across all its lines"
      },
      "ClientPricingEntry": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the entry"
          },
          "assetTypeUUID": {
            "description": "UUID of the asset type it prices, or null for a category",
            "type": ["string", "null"]
          },
          "assetTypeName": {
            "description": "Name of that asset type",
            "type": ["string", "null"]
          },
          "categoryUUID": {
            "description": "UUID of the category it prices (with its subcategories), or null for an asset type",
            "type": ["string", "null"]
          },
          "categoryName": {
            "description": "Name of that category",
            "type": ["string", "null"]
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "A fixed rate in the smallest currency unit, replacing the catalogue's (including an asset's own rate). Asset type entries only"
          },
          "adjustmentPercent": {
            "description": "Percentage added to the catalogue rate: -20 is 20% off. Not with `rate`",
            "type": ["number", "null"]
          },
          "priceStructureUUID": {
            "description": "UUID of a price structure to charge with instead of the catalogue's, e.g. a 3-day week for dry hire",
            "type": ["string", "null"]
          },
          "priceStructureName": {
            "description": "Name of that price structure",
            "type": ["string", "null"]
          }
        },
        "required": [
          "uuid",
          "assetTypeUUID",
          "assetTypeName",
          "categoryUUID",
          "categoryName",
          "rate",
          "adjustmentPercent",
          "priceStructureUUID",
          "priceStructureName"
        ],
        "additionalProperties": false,
        "description": "Client pricing's price for one asset type, or for every type in a category. An entry with no rate, percentage or structure charges catalogue prices, ignoring the list's own percentage"
      },
      "ClientPricing": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the client pricing"
          },
          "name": {
            "type": "string",
            "description": "Display name, e.g. 'Trade'"
          },
          "description": {
            "description": "What the list is for",
            "type": ["string", "null"]
          },
          "adjustmentPercent": {
            "description": "Percentage added to the catalogue rate of anything the list has no entry for: -15 is 15% off, 10 is 10% more. Null charges catalogue prices for those",
            "type": ["number", "null"]
          },
          "validFrom": {
            "description": "First date (YYYY-MM-DD) the list may be used on, for seasonal lists. Checked against the start of a project's charge period",
            "type": ["string", "null"]
          },
          "validTo": {
            "description": "Last date (YYYY-MM-DD) the list may be used on",
            "type": ["string", "null"]
          },
          "entryCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many entries the list has"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the list was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the list last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "adjustmentPercent",
          "validFrom",
          "validTo",
          "entryCount",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Client pricing: named alternative prices, such as 'Trade' or 'Dry hire', that a client's projects can use"
      },
      "ClientPricingDetail": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the client pricing"
          },
          "name": {
            "type": "string",
            "description": "Display name, e.g. 'Trade'"
          },
          "description": {
            "description": "What the list is for",
            "type": ["string", "null"]
          },
          "adjustmentPercent": {
            "description": "Percentage added to the catalogue rate of anything the list has no entry for: -15 is 15% off, 10 is 10% more. Null charges catalogue prices for those",
            "type": ["number", "null"]
          },
          "validFrom": {
            "description": "First date (YYYY-MM-DD) the list may be used on, for seasonal lists. Checked against the start of a project's charge period",
            "type": ["string", "null"]
          },
          "validTo": {
            "description": "Last date (YYYY-MM-DD) the list may be used on",
            "type": ["string", "null"]
          },
          "entryCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many entries the list has"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the list was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the list last changed"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientPricingEntry"
            },
            "description": "Every entry, categories first, then asset types, by name"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "adjustmentPercent",
          "validFrom",
          "validTo",
          "entryCount",
          "createdAt",
          "updatedAt",
          "entries"
        ],
        "additionalProperties": false,
        "description": "Client pricing with its entries"
      },
      "Location": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the location"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "address": {
            "description": "Postal address, if any",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Free-text notes, if any",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the location it is inside, or null for a top-level location",
            "type": ["string", "null"]
          },
          "clientUUID": {
            "description": "UUID of the client this location belongs to (e.g. a client's venue), or null",
            "type": ["string", "null"]
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the location was archived, or null if it is in use"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the location was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the location was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the location last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "address",
          "notes",
          "parentUUID",
          "clientUUID",
          "archivedAt",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A location: a venue, a warehouse, a shelf in a warehouse, ..."
      },
      "LocationTreeNode": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the location"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "address": {
            "description": "Postal address, if any",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Free-text notes, if any",
            "type": ["string", "null"]
          },
          "parentUUID": {
            "description": "UUID of the location it is inside, or null for a top-level location",
            "type": ["string", "null"]
          },
          "clientUUID": {
            "description": "UUID of the client this location belongs to (e.g. a client's venue), or null",
            "type": ["string", "null"]
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the location was archived, or null if it is in use"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the location was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the location was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the location last changed"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationTreeNode"
            },
            "description": "Locations inside this one, by name"
          }
        },
        "required": [
          "uuid",
          "name",
          "address",
          "notes",
          "parentUUID",
          "clientUUID",
          "archivedAt",
          "deletedAt",
          "createdAt",
          "updatedAt",
          "children"
        ],
        "additionalProperties": false,
        "description": "A location with the locations inside it"
      },
      "Client": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the client"
          },
          "name": {
            "type": "string",
            "description": "Name of the business or person"
          },
          "parentUUID": {
            "description": "UUID of the client this one sits under (e.g. a company within a group), or null for a top-level client",
            "type": ["string", "null"]
          },
          "website": {
            "description": "Website address",
            "type": ["string", "null"]
          },
          "clientPricingUUID": {
            "description": "UUID of the client pricing its new projects use, or null for catalogue prices. Set with clients.set-pricing",
            "type": ["string", "null"]
          },
          "address": {
            "description": "Postal address; lines are separated by newlines",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Free-text notes about the client",
            "type": ["string", "null"]
          },
          "taxExempt": {
            "type": "boolean",
            "description": "Projects for this client charge no tax, such as for a charity with relief or a client abroad"
          },
          "isSupplier": {
            "type": "boolean",
            "description": "The organisation also hires from this client, so it can be picked as a sub-hire supplier"
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the client was archived, or null if it is active. Archived clients can't be picked for new work"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the client was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the client was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the client last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "parentUUID",
          "website",
          "clientPricingUUID",
          "address",
          "notes",
          "taxExempt",
          "isSupplier",
          "archivedAt",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A client: a business or person the organisation hires to. The people to contact there are its contacts"
      },
      "ClientTimelineProject": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the project"
          },
          "number": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The project's number"
          },
          "name": {
            "type": "string",
            "description": "The project's name"
          }
        },
        "required": ["uuid", "number", "name"],
        "additionalProperties": false
      },
      "ClientTimelineEntry": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "PROJECT_CREATED",
              "QUOTE_ISSUED",
              "QUOTE_ACCEPTED",
              "QUOTE_DECLINED",
              "INVOICE_ISSUED",
              "CREDIT_NOTE_ISSUED",
              "PAYMENT",
              "REFUND",
              "DOCUMENT_EMAILED",
              "COMMENT"
            ],
            "description": "What happened: a project made for the client, a quote issued or answered, an invoice or credit note issued, a payment or refund, a document emailed to the client, or a comment on the client"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it happened"
          },
          "uuid": {
            "type": "string",
            "description": "UUID of the record it's about: the project, quote, invoice, payment, document file or comment"
          },
          "project": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientTimelineProject"
              },
              {
                "type": "null"
              }
            ],
            "description": "The project it belongs to, or null for a comment"
          },
          "title": {
            "type": "string",
            "description": "A short label, such as the quote or invoice number, the document's file name or the start of the comment"
          },
          "amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The amount in the smallest currency unit, for quotes, invoices, credit notes, payments and refunds"
          },
          "byUUID": {
            "description": "UUID of the member who did it, if known",
            "type": ["string", "null"]
          },
          "byName": {
            "description": "Name of the member who did it, if known",
            "type": ["string", "null"]
          }
        },
        "required": [
          "kind",
          "at",
          "uuid",
          "project",
          "title",
          "amount",
          "byUUID",
          "byName"
        ],
        "additionalProperties": false
      },
      "ClientContact": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the contact"
          },
          "clientUUID": {
            "type": "string",
            "description": "UUID of the client the contact is at"
          },
          "name": {
            "type": "string",
            "description": "The person's name"
          },
          "jobTitle": {
            "description": "Their job title or role, e.g. 'Production Manager'",
            "type": ["string", "null"]
          },
          "email": {
            "description": "Their email address",
            "type": ["string", "null"]
          },
          "phone": {
            "description": "Their phone number",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Free-text notes about them",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the contact was added"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the contact last changed"
          }
        },
        "required": [
          "uuid",
          "clientUUID",
          "name",
          "jobTitle",
          "email",
          "phone",
          "notes",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A person at a client"
      },
      "Invitation": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the invitation"
          },
          "email": {
            "type": "string",
            "description": "Email address the invitation was sent to"
          },
          "roleUUID": {
            "type": "string",
            "description": "UUID of the role the invitee will be given when they join"
          },
          "roleName": {
            "type": "string",
            "description": "Name of that role"
          },
          "invitedByUserUuid": {
            "type": "string",
            "description": "UUID of the user who sent the invitation"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the invitation was created"
          },
          "lastSentAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the invitation email was last sent"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the link in the latest email stops working"
          },
          "expired": {
            "type": "boolean",
            "description": "Whether the invitation has expired"
          },
          "canResend": {
            "type": "boolean",
            "description": "Whether the email can be sent again. Each invitation can be sent at most 3 times"
          }
        },
        "required": [
          "uuid",
          "email",
          "roleUUID",
          "roleName",
          "invitedByUserUuid",
          "createdAt",
          "lastSentAt",
          "expiresAt",
          "expired",
          "canResend"
        ],
        "additionalProperties": false,
        "description": "A pending invitation to join the organisation"
      },
      "Member": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "The user's UUID"
          },
          "firstName": {
            "type": "string",
            "description": "First name"
          },
          "lastName": {
            "type": "string",
            "description": "Last name"
          },
          "email": {
            "type": "string",
            "description": "Email address"
          },
          "jobTitle": {
            "description": "Job title, if set",
            "type": ["string", "null"]
          },
          "roleUUID": {
            "type": "string",
            "description": "UUID of the member's role"
          },
          "roleName": {
            "type": "string",
            "description": "Name of the member's role"
          },
          "roleType": {
            "type": "string",
            "enum": ["ADMINISTRATOR", "EDITOR", "VIEWER", "CUSTOM"],
            "description": "Type of the member's role"
          },
          "removed": {
            "type": "boolean",
            "description": "Whether the member has been removed from the organisation"
          },
          "hasLicence": {
            "type": "boolean",
            "description": "Whether the member holds a user licence. Without one they cannot use the organisation"
          },
          "removeAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the member is set to be removed, such as the end of their contract, or null. From then on they can't use the organisation"
          }
        },
        "required": [
          "uuid",
          "firstName",
          "lastName",
          "email",
          "jobTitle",
          "roleUUID",
          "roleName",
          "roleType",
          "removed",
          "hasLicence",
          "removeAt"
        ],
        "additionalProperties": false,
        "description": "A member of the organisation"
      },
      "MemberProfile": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "The user's UUID"
          },
          "firstName": {
            "type": "string",
            "description": "First name"
          },
          "lastName": {
            "type": "string",
            "description": "Last name"
          },
          "email": {
            "type": "string",
            "description": "Email address"
          },
          "jobTitle": {
            "description": "Job title, if set",
            "type": ["string", "null"]
          },
          "roleUUID": {
            "type": "string",
            "description": "UUID of the member's role"
          },
          "roleName": {
            "type": "string",
            "description": "Name of the member's role"
          },
          "roleType": {
            "type": "string",
            "enum": ["ADMINISTRATOR", "EDITOR", "VIEWER", "CUSTOM"],
            "description": "Type of the member's role"
          },
          "removed": {
            "type": "boolean",
            "description": "Whether the member has been removed from the organisation"
          },
          "hasLicence": {
            "type": "boolean",
            "description": "Whether the member holds a user licence. Without one they cannot use the organisation"
          },
          "removeAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the member is set to be removed, such as the end of their contract, or null. From then on they can't use the organisation"
          },
          "joinedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When they first joined the organisation. Null for removed members"
          },
          "joinedViaCode": {
            "description": "The join code they joined with. Null if they didn't, or the caller can't see join codes",
            "type": ["string", "null"]
          }
        },
        "required": [
          "uuid",
          "firstName",
          "lastName",
          "email",
          "jobTitle",
          "roleUUID",
          "roleName",
          "roleType",
          "removed",
          "hasLicence",
          "removeAt",
          "joinedAt",
          "joinedViaCode"
        ],
        "additionalProperties": false,
        "description": "A member of the organisation, with details for their profile"
      },
      "Licence": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "The licence's UUID"
          },
          "bundled": {
            "type": "boolean",
            "description": "Whether the licence comes with the plan. Otherwise it is an extra licence, bought on top"
          },
          "member": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "The member's user UUID"
                  },
                  "firstName": {
                    "type": "string",
                    "description": "First name"
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name"
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address"
                  }
                },
                "required": ["uuid", "firstName", "lastName", "email"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Who holds the licence, or null if it is free to assign"
          },
          "assignedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was given to its member, or null if it is free"
          },
          "reassignableAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "A licence can't be taken back for a day after it is given. Until this time, it can't be unassigned"
          }
        },
        "required": [
          "uuid",
          "bundled",
          "member",
          "assignedAt",
          "reassignableAt"
        ],
        "additionalProperties": false,
        "description": "One of the organisation's licences. Each member needs one"
      },
      "OrganisationFile": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the file or link"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "category": {
            "type": "string",
            "enum": [
              "INVOICES",
              "DOCUMENTS",
              "ASSET_THUMBNAILS",
              "RECEIPTS",
              "PROJECT_FILES",
              "ATTACHMENTS",
              "COMMENT_ATTACHMENTS",
              "SCAN_MEDIA",
              "CERTIFICATION_EVIDENCE",
              "CREW_APPLICATIONS",
              "AI_IMPORTS",
              "GENERATED_DOCUMENTS",
              "ISSUED_DOCUMENTS",
              "DATABASE_BACKUPS"
            ],
            "description": "The file's category: where it lives in the organisation's files, such as `DOCUMENTS` or `PROJECT_FILES`"
          },
          "extension": {
            "type": "string",
            "description": "File extension, such as `pdf`, or `link` for a link"
          },
          "mimeType": {
            "description": "Content type, if known",
            "type": ["string", "null"]
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Size in bytes. 0 for a link"
          },
          "isLink": {
            "type": "boolean",
            "description": "Whether this is a link to a URL rather than a stored file"
          },
          "linkUrl": {
            "description": "The URL, for a link",
            "type": ["string", "null"]
          },
          "recordType": {
            "description": "The kind of record the file is attached to, such as `location`, or null if it only lives in its category",
            "type": ["string", "null"]
          },
          "recordUuid": {
            "description": "UUID of the record it is attached to, if any",
            "type": ["string", "null"]
          },
          "uploadedByUserUuid": {
            "description": "User UUID of the member who added it",
            "type": ["string", "null"]
          },
          "deleted": {
            "type": "boolean",
            "description": "Whether it is in the trash. Files in the trash are deleted for good after 30 days"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was moved to the trash"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was added"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "name",
          "category",
          "extension",
          "mimeType",
          "sizeBytes",
          "isLink",
          "linkUrl",
          "recordType",
          "recordUuid",
          "uploadedByUserUuid",
          "deleted",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "A file or link in the organisation's files"
      },
      "Role": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the role"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "description": {
            "description": "Optional description",
            "type": ["string", "null"]
          },
          "type": {
            "type": "string",
            "enum": ["ADMINISTRATOR", "EDITOR", "VIEWER", "CUSTOM"],
            "description": "`CUSTOM` roles are the organisation's own; the others are built in and cannot be changed"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "AUDIT_LOGS.VIEW",
                "AI_USAGE.VIEW",
                "ORGANISATIONS_USERS.VIEW",
                "ORGANISATIONS_USERS.CREATE",
                "ORGANISATIONS_USERS.UPDATE",
                "ORGANISATIONS_USERS.DELETE",
                "ORGANISATIONS_USERS.VIEW_DELETED",
                "ORGANISATIONS_USERS.RESTORE",
                "ORGANISATIONS_USERS.SEND",
                "ORGANISATIONS_PERMISSIONS.VIEW",
                "ORGANISATIONS_PERMISSIONS.CREATE",
                "ORGANISATIONS_PERMISSIONS.UPDATE",
                "ORGANISATIONS_PERMISSIONS.DELETE",
                "ORGANISATIONS_PERMISSIONS.VIEW_DELETED",
                "ORGANISATIONS_PERMISSIONS.RESTORE",
                "ORGANISATIONS_LICENCES.VIEW",
                "ORGANISATIONS_LICENCES.UPDATE",
                "ORGANISATIONS_JOIN_METHODS.VIEW",
                "ORGANISATIONS_JOIN_METHODS.CREATE",
                "ORGANISATIONS_JOIN_METHODS.UPDATE",
                "ORGANISATIONS_JOIN_METHODS.DELETE",
                "WEBHOOKS.VIEW",
                "WEBHOOKS.CREATE",
                "WEBHOOKS.UPDATE",
                "WEBHOOKS.DELETE",
                "ORGANISATIONS_SUBSCRIPTION.VIEW",
                "ORGANISATIONS_SUBSCRIPTION.UPDATE",
                "ORGANISATION_FILES.VIEW",
                "ORGANISATION_FILES.CREATE",
                "ORGANISATION_FILES.UPDATE",
                "ORGANISATION_FILES.DELETE",
                "ORGANISATIONS_SETTINGS.VIEW",
                "ORGANISATIONS_SETTINGS.UPDATE",
                "ASSET_CATEGORIES.VIEW",
                "ASSET_CATEGORIES.COMMENT",
                "ASSET_CATEGORIES.CREATE",
                "ASSET_CATEGORIES.UPDATE",
                "ASSET_CATEGORIES.DELETE",
                "ASSET_CATEGORIES.VIEW_DELETED",
                "ASSET_CATEGORIES.RESTORE",
                "CLIENTS.VIEW",
                "CLIENTS.COMMENT",
                "CLIENTS.CREATE",
                "CLIENTS.UPDATE",
                "CLIENTS.DELETE",
                "CLIENTS.VIEW_DELETED",
                "LOCATIONS.VIEW",
                "LOCATIONS.COMMENT",
                "LOCATIONS.CREATE",
                "LOCATIONS.UPDATE",
                "LOCATIONS.DELETE",
                "LOCATIONS.VIEW_DELETED",
                "MANUFACTURERS.VIEW",
                "MANUFACTURERS.COMMENT",
                "MANUFACTURERS.CREATE",
                "MANUFACTURERS.UPDATE",
                "MANUFACTURERS.DELETE",
                "MANUFACTURERS.VIEW_DELETED",
                "ASSET_TYPES.VIEW",
                "ASSET_TYPES.COMMENT",
                "ASSET_TYPES.CREATE",
                "ASSET_TYPES.UPDATE",
                "ASSET_TYPES.DELETE",
                "ASSET_TYPES.VIEW_DELETED",
                "ASSETS.VIEW",
                "ASSETS.COMMENT",
                "ASSETS.CREATE",
                "ASSETS.UPDATE",
                "ASSETS.ARCHIVE",
                "ASSETS.MANAGE_IDS",
                "ASSETS.EDIT_PRICING",
                "ASSETS.ADJUST_STOCK",
                "ASSETS.SCAN",
                "ASSETS.IMPORT",
                "ASSETS.DELETE",
                "ASSETS.VIEW_DELETED",
                "ASSETS.RESTORE",
                "MAINTENANCE_JOBS.VIEW",
                "MAINTENANCE_JOBS.COMMENT",
                "MAINTENANCE_JOBS.CREATE",
                "MAINTENANCE_JOBS.UPDATE",
                "MAINTENANCE_JOBS.FLAG_AND_BLOCK",
                "MAINTENANCE_JOBS.DELETE",
                "PROJECTS.VIEW",
                "PROJECTS.COMMENT",
                "PROJECTS.CREATE",
                "PROJECTS.UPDATE",
                "PROJECTS.DELETE",
                "PROJECTS.VIEW_DELETED",
                "PROJECTS.RESTORE",
                "PROJECT_TEMPLATES.VIEW",
                "PROJECT_TEMPLATES.CREATE",
                "PROJECT_TEMPLATES.UPDATE",
                "PROJECT_TEMPLATES.DELETE",
                "CALENDAR.VIEW",
                "DASHBOARD.VIEW",
                "PROJECT_ASSETS.VIEW",
                "PROJECT_ASSETS.UPDATE",
                "PROJECT_ASSETS.PRICES",
                "QUOTES.VIEW",
                "QUOTES.ISSUE",
                "QUOTES.UPDATE",
                "INVOICES.VIEW",
                "INVOICES.CREATE",
                "INVOICES.ISSUE",
                "INVOICES.CREDIT",
                "PAYMENTS.VIEW",
                "PAYMENTS.RECORD",
                "PAYMENTS.DELETE",
                "PROJECT_CREW.VIEW",
                "PROJECT_CREW.UPDATE",
                "PROJECT_CREW.EMAIL",
                "PROJECT_CREW.RECRUIT",
                "PROJECT_CREW.APPLY",
                "INSPECTIONS.VIEW",
                "INSPECTIONS.RECORD",
                "INSPECTIONS.DELETE",
                "DOCUMENT_TEMPLATES.VIEW",
                "DOCUMENT_TEMPLATES.CREATE",
                "DOCUMENT_TEMPLATES.UPDATE",
                "DOCUMENT_TEMPLATES.DELETE",
                "DOCUMENT_TEMPLATES.EMAIL_CLIENTS",
                "ASSET_GROUPS.VIEW",
                "ASSET_GROUPS.CREATE",
                "ASSET_GROUPS.UPDATE",
                "ASSET_GROUPS.DELETE",
                "WIKI_PAGES.VIEW",
                "WIKI_PAGES.CREATE",
                "WIKI_PAGES.UPDATE",
                "WIKI_PAGES.DELETE",
                "WIKI_PAGES.VIEW_STATS",
                "WIKI_PAGES.SET_DASHBOARDS",
                "TRAINING_MODULES.VIEW",
                "TRAINING_MODULES.CREATE",
                "TRAINING_MODULES.UPDATE",
                "TRAINING_MODULES.DELETE",
                "TRAINING_MODULES.VIEW_PROGRESS",
                "CERTIFICATION_TYPES.VIEW",
                "CERTIFICATION_TYPES.CREATE",
                "CERTIFICATION_TYPES.UPDATE",
                "CERTIFICATION_TYPES.DELETE",
                "MEMBER_CERTIFICATIONS.VIEW",
                "MEMBER_CERTIFICATIONS.CREATE",
                "MEMBER_CERTIFICATIONS.UPDATE",
                "MEMBER_CERTIFICATIONS.REVOKE",
                "LABEL_TEMPLATES.VIEW",
                "LABEL_TEMPLATES.CREATE",
                "LABEL_TEMPLATES.UPDATE",
                "LABEL_TEMPLATES.DELETE",
                "PACKAGES.VIEW",
                "PACKAGES.CREATE",
                "PACKAGES.UPDATE",
                "PACKAGES.DELETE",
                "PRICE_STRUCTURES.VIEW",
                "PRICE_STRUCTURES.CREATE",
                "PRICE_STRUCTURES.UPDATE",
                "PRICE_STRUCTURES.DELETE",
                "CLIENT_PRICING.VIEW",
                "CLIENT_PRICING.CREATE",
                "CLIENT_PRICING.UPDATE",
                "CLIENT_PRICING.DELETE",
                "CUSTOM_FIELDS.VIEW",
                "CUSTOM_FIELDS.CREATE",
                "CUSTOM_FIELDS.UPDATE",
                "CUSTOM_FIELDS.DELETE",
                "COMMENTS.VIEW",
                "COMMENTS.UPDATE",
                "SEARCH.VIEW",
                "APPS.VIEW",
                "APPS.CREATE",
                "APPS.UPDATE",
                "APPS.DELETE",
                "APPS.INSTALL",
                "APPS.RUN",
                "APPS.PUBLISH"
              ],
              "description": "A permission, `<AREA>.<ACTION>`, e.g. `ASSET_CATEGORIES.VIEW`"
            },
            "description": "Everything members with this role can do"
          },
          "memberCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many current members have this role"
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Where a custom role is listed, lowest first. Built-in roles always come first"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "type",
          "permissions",
          "memberCount",
          "position"
        ],
        "additionalProperties": false,
        "description": "A role: a named set of permissions members can be given"
      },
      "JoinCode": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The code (lower case). Its link is `/{lang}/join-business/{code}`"
          },
          "roleUUID": {
            "type": "string",
            "description": "UUID of the role people who join with it are given"
          },
          "roleName": {
            "description": "Name of that role, or null if it no longer exists",
            "type": ["string", "null"]
          },
          "active": {
            "type": "boolean",
            "description": "Whether the code can be used to join"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the code was created"
          },
          "jobTitle": {
            "description": "Job title given to everyone who joins with it, or null",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Notes for administrators, such as where it was shared",
            "type": ["string", "null"]
          },
          "uses": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many people have joined with it, including any since removed"
          }
        },
        "required": [
          "code",
          "roleUUID",
          "roleName",
          "active",
          "createdAt",
          "jobTitle",
          "notes",
          "uses"
        ],
        "additionalProperties": false,
        "description": "A code anyone can use to join the organisation, with a set role"
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "The webhook's UUID"
          },
          "url": {
            "type": "string",
            "description": "The HTTPS address events are sent to"
          },
          "description": {
            "description": "What the webhook is for, such as the system it feeds",
            "type": ["string", "null"]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The event types it is sent: function keys such as `clients.create`, or a whole feature such as `clients.*`"
          },
          "active": {
            "type": "boolean",
            "description": "Whether it is sent events. Turned off by hand, or automatically when the receiver answers 410 Gone"
          },
          "disabledReason": {
            "description": "Why AdamRMS turned it off, if it did",
            "type": ["string", "null"]
          },
          "ownerUserUuid": {
            "type": "string",
            "description": "UUID of the member who made it. It is only sent events about records they can see"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was made"
          },
          "lastDelivery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": ["PENDING", "SUCCEEDED", "FAILED", "SKIPPED"],
                    "description": "Whether the latest event was delivered"
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                    "description": "When the latest event happened"
                  }
                },
                "required": ["status", "at"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The latest event sent to it, or null if none has been"
          }
        },
        "required": [
          "uuid",
          "url",
          "description",
          "events",
          "active",
          "disabledReason",
          "ownerUserUuid",
          "createdAt",
          "lastDelivery"
        ],
        "additionalProperties": false,
        "description": "An address AdamRMS sends signed events to when things change"
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "The event's ID, sent as the `webhook-id` header"
          },
          "eventType": {
            "type": "string",
            "description": "The function whose call made the event, such as `clients.create`"
          },
          "status": {
            "type": "string",
            "enum": ["PENDING", "SUCCEEDED", "FAILED", "SKIPPED"],
            "description": "PENDING while it is waiting to be sent or retried, SUCCEEDED once the receiver answered with a 2xx status, FAILED when every attempt failed, SKIPPED when it wasn't sent"
          },
          "attempts": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many times it has been sent"
          },
          "lastStatusCode": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The HTTP status of the latest attempt, or null if it got none"
          },
          "lastError": {
            "description": "What went wrong with the latest attempt, if anything",
            "type": ["string", "null"]
          },
          "nextAttemptAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it will next be sent, while it is pending"
          },
          "lastAttemptAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was last sent"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the event happened"
          }
        },
        "required": [
          "uuid",
          "eventType",
          "status",
          "attempts",
          "lastStatusCode",
          "lastError",
          "nextAttemptAt",
          "lastAttemptAt",
          "createdAt"
        ],
        "additionalProperties": false,
        "description": "One event sent to a webhook, with its latest attempt"
      },
      "EmailDomain": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The email domain, e.g. `example.com`"
          },
          "roleUUID": {
            "type": "string",
            "description": "UUID of the role people who join this way are given"
          },
          "roleName": {
            "description": "Name of that role, or null if it no longer exists",
            "type": ["string", "null"]
          },
          "active": {
            "type": "boolean",
            "description": "Whether people with this domain can currently join"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the domain was added"
          }
        },
        "required": ["domain", "roleUUID", "roleName", "active", "createdAt"],
        "additionalProperties": false,
        "description": "An email domain whose users can join the organisation once they have verified their email address"
      },
      "SingleSignOnDomain": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The email domain, such as `example.com`"
          },
          "verified": {
            "type": "boolean",
            "description": "Whether the organisation has proved it owns the domain. Single sign-on only signs in addresses at verified domains"
          },
          "verifiedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the domain was verified, or null if it isn't yet"
          },
          "txtRecordName": {
            "type": "string",
            "description": "The DNS name the TXT record goes on to verify the domain"
          },
          "txtRecordValue": {
            "type": "string",
            "description": "The value the TXT record must hold to verify the domain"
          }
        },
        "required": [
          "domain",
          "verified",
          "verifiedAt",
          "txtRecordName",
          "txtRecordValue"
        ],
        "additionalProperties": false,
        "description": "An email domain for single sign-on"
      },
      "SingleSignOn": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether members can sign in through the identity provider"
          },
          "required": {
            "type": "boolean",
            "description": "Whether members at a verified domain must sign in through the identity provider to use the organisation. Administrators can still sign in another way"
          },
          "idpEntityId": {
            "description": "The identity provider's entity ID (its issuer)",
            "type": ["string", "null"]
          },
          "idpSignOnUrl": {
            "description": "The identity provider's single sign-on URL, for the HTTP-Redirect binding",
            "type": ["string", "null"]
          },
          "idpCertificates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pem": {
                  "type": "string",
                  "description": "The certificate, PEM encoded"
                },
                "subject": {
                  "type": "string",
                  "description": "Who the certificate names"
                },
                "validTo": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When the certificate expires. Sign-in stops working after it"
                }
              },
              "required": ["pem", "subject", "validTo"],
              "additionalProperties": false,
              "description": "A certificate the identity provider signs with"
            },
            "description": "Certificates the identity provider signs responses with"
          },
          "newMemberRoleUUID": {
            "description": "UUID of the role people get when they first sign in through single sign-on and aren't yet members",
            "type": ["string", "null"]
          },
          "serviceProvider": {
            "type": "object",
            "properties": {
              "entityId": {
                "type": "string",
                "description": "AdamRMS's entity ID, for the identity provider"
              },
              "acsUrl": {
                "type": "string",
                "description": "The assertion consumer service (reply) URL, for the identity provider"
              },
              "metadataUrl": {
                "type": "string",
                "description": "AdamRMS's SAML metadata"
              },
              "signInUrl": {
                "type": "string",
                "description": "A link that starts signing in through single sign-on"
              }
            },
            "required": ["entityId", "acsUrl", "metadataUrl", "signInUrl"],
            "additionalProperties": false,
            "description": "What to enter in the identity provider"
          },
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SingleSignOnDomain"
            },
            "description": "The organisation's email domains for single sign-on"
          }
        },
        "required": [
          "enabled",
          "required",
          "idpEntityId",
          "idpSignOnUrl",
          "idpCertificates",
          "newMemberRoleUUID",
          "serviceProvider",
          "domains"
        ],
        "additionalProperties": false,
        "description": "The organisation's SAML single sign-on"
      },
      "OrganisationUrl": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "The URL slug - the organisation is at `/{lang}/org/{slug}`"
          },
          "active": {
            "type": "boolean",
            "description": "Whether this is the current URL. Former URLs redirect to the current one"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the URL was first used"
          }
        },
        "required": ["slug", "active", "createdAt"],
        "additionalProperties": false,
        "description": "One of the organisation's URLs, current or former"
      },
      "FinanceSettings": {
        "type": "object",
        "properties": {
          "invoicePrefix": {
            "type": "string",
            "description": "Put before invoice numbers, such as 'INV-' for INV-0001. Deposit invoices share the sequence"
          },
          "nextInvoiceNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The number the next invoice gets. It can't go back to a number already used"
          },
          "lowestNextInvoiceNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The lowest the next invoice number can be set to: one more than the highest used"
          },
          "creditNotePrefix": {
            "type": "string",
            "description": "Put before credit note numbers, such as 'CN-' for CN-0001"
          },
          "nextCreditNoteNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The number the next credit note gets. It can't go back to a number already used"
          },
          "lowestNextCreditNoteNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The lowest the next credit note number can be set to: one more than the highest used"
          },
          "quotePrefix": {
            "type": "string",
            "description": "Put before quote numbers, such as 'QUO-' for QUO-0001"
          },
          "nextQuoteNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The number the next quote gets. It can't go back to a number already used"
          },
          "lowestNextQuoteNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The lowest the next quote number can be set to: one more than the highest used"
          },
          "numberDigits": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many digits numbers are padded to with leading zeros, such as 4 for 0001"
          },
          "paymentTermsDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Days from issuing an invoice to when it's due, such as 30. 0 makes invoices due on issue"
          },
          "quoteValidDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Days a quote is valid for after it's issued, such as 30. 0 for quotes with no expiry"
          },
          "depositBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The deposit a deposit invoice asks for by default, as a share of the project's total in basis points (2500 is 25%). 0 for none"
          },
          "linkedDiscountBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The discount on assets that go out because they're in a case that was added to a project, in basis points (10000 is 100%, so they're free). Applies to assets added from now on, not those already on projects"
          }
        },
        "required": [
          "invoicePrefix",
          "nextInvoiceNumber",
          "lowestNextInvoiceNumber",
          "creditNotePrefix",
          "nextCreditNoteNumber",
          "lowestNextCreditNoteNumber",
          "quotePrefix",
          "nextQuoteNumber",
          "lowestNextQuoteNumber",
          "numberDigits",
          "paymentTermsDays",
          "quoteValidDays",
          "depositBp",
          "linkedDiscountBp"
        ],
        "additionalProperties": false,
        "description": "How quotes, invoices and credit notes are numbered, and the organisation's payment terms"
      },
      "ProjectFinance": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code"
          },
          "taxName": {
            "type": "string",
            "description": "What tax is called, such as VAT"
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's on the project, before tax"
          },
          "tax": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Tax on what's on the project"
          },
          "gross": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's on the project, with tax"
          },
          "invoiced": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Issued invoices, less credit notes, with tax"
          },
          "uninvoiced": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's on the project and not yet invoiced: gross less invoiced. Negative when more has been invoiced than is on it now"
          },
          "paid": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Payments received less refunds. Null if you can't see payments"
          },
          "balance": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "What the client still owes for the project: gross less paid. Null if you can't see payments"
          },
          "depositsHeld": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Damage deposits taken and not yet returned or kept. Null if you can't see payments"
          },
          "defaultDepositBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The organisation's default deposit, in basis points, for deposit invoices"
          },
          "quoteValidDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Days a new quote is valid for by default. 0 for quotes with no expiry"
          }
        },
        "required": [
          "currency",
          "taxName",
          "net",
          "tax",
          "gross",
          "invoiced",
          "uninvoiced",
          "paid",
          "balance",
          "depositsHeld",
          "defaultDepositBp",
          "quoteValidDays"
        ],
        "additionalProperties": false,
        "description": "A project's money, with its sub-projects: what's on it, invoiced and paid, in the smallest currency unit"
      },
      "ClientFinance": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "type": "string",
            "description": "UUID of the client"
          },
          "projects": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many of the client's projects are counted"
          },
          "gross": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's on those projects, with tax"
          },
          "invoiced": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Issued invoices on them, less credit notes, with tax"
          },
          "paid": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Payments received on them less refunds. Null if you can't see payments"
          },
          "balance": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "What the client still owes: gross less paid. Negative when they've paid more. Null if you can't see payments"
          }
        },
        "required": [
          "clientUUID",
          "projects",
          "gross",
          "invoiced",
          "paid",
          "balance"
        ],
        "additionalProperties": false,
        "description": "A client's money, over their projects"
      },
      "StatementEntry": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": ["INVOICE", "DEPOSIT", "CREDIT_NOTE", "PAYMENT", "REFUND"],
            "description": "INVOICE and DEPOSIT are issued invoices and deposit invoices, CREDIT_NOTE an issued credit note, PAYMENT money received and REFUND money paid back"
          },
          "uuid": {
            "type": "string",
            "description": "UUID of the invoice, credit note or payment"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the invoice was issued, or the payment made"
          },
          "number": {
            "description": "The invoice or credit note's number. Null for payments",
            "type": ["string", "null"]
          },
          "reference": {
            "description": "The client's reference on an invoice, such as a purchase order, or the payment's reference",
            "type": ["string", "null"]
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When an invoice or deposit invoice is due to be paid"
          },
          "invoice": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the invoice"
                  },
                  "number": {
                    "description": "The invoice's number",
                    "type": ["string", "null"]
                  }
                },
                "required": ["uuid", "number"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "For a payment or refund, the invoice it pays or refunds. For a credit note, the invoice it credits"
          },
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project it's on"
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What it changes the balance by, with tax. Positive adds to what the client owes (invoices, refunds), negative takes it off (credit notes, payments)"
          },
          "balance": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What the client owes after this entry"
          }
        },
        "required": [
          "kind",
          "uuid",
          "date",
          "number",
          "reference",
          "dueAt",
          "invoice",
          "project",
          "amount",
          "balance"
        ],
        "additionalProperties": false,
        "description": "One line of a client's statement"
      },
      "UnpaidInvoice": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the invoice"
          },
          "kind": {
            "type": "string",
            "enum": ["INVOICE", "DEPOSIT"],
            "description": "Invoice or deposit invoice"
          },
          "number": {
            "description": "The invoice's number",
            "type": ["string", "null"]
          },
          "issuedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was issued"
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it's due to be paid"
          },
          "overdue": {
            "type": "boolean",
            "description": "True once its due date has passed"
          },
          "gross": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Its total, with tax"
          },
          "due": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's still to pay on it, less partial credit notes"
          },
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project it's on"
          }
        },
        "required": [
          "uuid",
          "kind",
          "number",
          "issuedAt",
          "dueAt",
          "overdue",
          "gross",
          "due",
          "project"
        ],
        "additionalProperties": false,
        "description": "An issued invoice with something still to pay"
      },
      "ClientStatement": {
        "type": "object",
        "properties": {
          "client": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the client"
              },
              "name": {
                "type": "string",
                "description": "The client's name"
              },
              "address": {
                "description": "The client's address",
                "type": ["string", "null"]
              }
            },
            "required": ["uuid", "name", "address"],
            "additionalProperties": false,
            "description": "Who the statement is for"
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code of the amounts"
          },
          "from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Start of the statement, or null from the first invoice"
          },
          "to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "End of the statement, or null for up to now"
          },
          "openingBalance": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What the client owed before the first entry: everything before `from`, and any entries left out over the limit"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatementEntry"
            },
            "description": "Invoices, credit notes, payments and refunds, oldest first, each with the balance after it. At most 1000: the latest are kept"
          },
          "earlierEntries": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many entries in the period were left out over the limit, and added into the opening balance"
          },
          "invoiced": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Invoices less credit notes in the period, with tax"
          },
          "paid": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Payments less refunds in the period"
          },
          "closingBalance": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What the client owes at the end: invoiced less paid. Negative when they've paid more. Work not yet invoiced isn't in it"
          },
          "overdue": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's still to pay on invoices past their due date, as of now"
          },
          "unpaidInvoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnpaidInvoice"
            },
            "description": "Issued invoices with something still to pay as of now, oldest due first. At most 1000"
          }
        },
        "required": [
          "client",
          "currency",
          "from",
          "to",
          "openingBalance",
          "entries",
          "earlierEntries",
          "invoiced",
          "paid",
          "closingBalance",
          "overdue",
          "unpaidInvoices"
        ],
        "additionalProperties": false,
        "description": "A client's statement: what they've been invoiced and paid across their projects, with a running balance, in the smallest currency unit"
      },
      "PaymentMethod": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the payment method"
          },
          "name": {
            "type": "string",
            "description": "Display name, such as 'Bank transfer' or 'Card'"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": ["uuid", "name", "createdAt", "updatedAt"],
        "additionalProperties": false,
        "description": "How money was paid, such as 'Bank transfer' or 'Card'"
      },
      "Payment": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the payment"
          },
          "kind": {
            "type": "string",
            "enum": [
              "PAYMENT",
              "REFUND",
              "DEPOSIT_TAKEN",
              "DEPOSIT_RETURNED",
              "DEPOSIT_RETAINED"
            ],
            "description": "PAYMENT is money received from the client. REFUND is money paid back. DEPOSIT_TAKEN is a damage or security deposit received and held, which isn't income. DEPOSIT_RETURNED is a held deposit paid back. DEPOSIT_RETAINED is a held deposit kept, which comes with a charge on the project and a PAYMENT for it"
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How much, in the smallest currency unit (such as pence). Always positive: the kind says which way it went"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the money was paid, as an ISO 8601 date and time"
          },
          "method": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the payment method"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the payment method"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "How it was paid"
          },
          "reference": {
            "description": "A reference, such as the bank transfer's reference, or null",
            "type": ["string", "null"]
          },
          "comment": {
            "description": "A note about the payment, or null",
            "type": ["string", "null"]
          },
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project it was paid on"
          },
          "client": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the client"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the client"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The project's client"
          },
          "invoice": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the invoice"
                  },
                  "number": {
                    "description": "The invoice's number",
                    "type": ["string", "null"]
                  }
                },
                "required": ["uuid", "number"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The invoice it pays or refunds, or null"
          },
          "chargeLineUUID": {
            "description": "For a retained deposit, and its payment: the line it became on the project",
            "type": ["string", "null"]
          },
          "linkedPaymentUUID": {
            "description": "For a retained deposit: its PAYMENT. For that PAYMENT: the DEPOSIT_RETAINED it came from",
            "type": ["string", "null"]
          },
          "recordedByUUID": {
            "description": "UUID of the member who recorded it",
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was recorded"
          },
          "fileCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many files, such as receipts, are attached to it. List them with attachments.list, record type `payment`"
          }
        },
        "required": [
          "uuid",
          "kind",
          "amount",
          "date",
          "method",
          "reference",
          "comment",
          "project",
          "client",
          "invoice",
          "chargeLineUUID",
          "linkedPaymentUUID",
          "recordedByUUID",
          "createdAt",
          "fileCount"
        ],
        "additionalProperties": false,
        "description": "Money in or out on a project"
      },
      "Billing": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "description": "UUID of the client",
            "type": ["string", "null"]
          },
          "clientName": {
            "description": "The client's name",
            "type": ["string", "null"]
          },
          "contactName": {
            "description": "The project's contact at the client",
            "type": ["string", "null"]
          },
          "address": {
            "description": "The client's address",
            "type": ["string", "null"]
          }
        },
        "required": ["clientUUID", "clientName", "contactName", "address"],
        "additionalProperties": false,
        "description": "Who it's made out to. Copied from the project's client while it's a draft, and frozen when it's issued"
      },
      "InvoiceLine": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the invoice line"
          },
          "kind": {
            "type": "string",
            "enum": ["LINE", "ADJUSTMENT", "DEPOSIT", "DEPOSIT_DEDUCTION"],
            "description": "LINE is a project line invoiced for the first time. ADJUSTMENT is what a project line changed by since it was last invoiced. DEPOSIT is part of the project's total at one tax rate. DEPOSIT_DEDUCTION takes an earlier deposit invoice off"
          },
          "projectLineUUID": {
            "description": "UUID of the project line it invoices",
            "type": ["string", "null"]
          },
          "depositInvoice": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the deposit invoice"
                  },
                  "number": {
                    "description": "The deposit invoice's number",
                    "type": ["string", "null"]
                  }
                },
                "required": ["uuid", "number"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "For DEPOSIT_DEDUCTION: the deposit invoice it takes off"
          },
          "projectName": {
            "type": "string",
            "description": "The project or sub-project it's on, for grouping"
          },
          "description": {
            "type": "string",
            "description": "What it's for. Empty for deposits and deductions"
          },
          "comment": {
            "description": "The line's comment, or null",
            "type": ["string", "null"]
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many"
          },
          "depth": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "0 for a line, 1 for an accessory under it, and so on"
          },
          "units": {
            "type": "number",
            "description": "Chargeable units, such as days"
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Rate of one in the smallest currency unit, or null"
          },
          "discountBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Discount in basis points (1000 is 10%)"
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Amount before tax"
          },
          "taxRateUUID": {
            "description": "UUID of the tax rate",
            "type": ["string", "null"]
          },
          "taxRateName": {
            "type": "string",
            "description": "The tax rate's name, or empty"
          },
          "taxRateBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Tax rate in basis points"
          },
          "tax": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Tax on the line"
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentDetail"
            },
            "description": "Custom field values printed under the line, such as a lantern's power, as they were when the line was drafted"
          }
        },
        "required": [
          "uuid",
          "kind",
          "projectLineUUID",
          "depositInvoice",
          "projectName",
          "description",
          "comment",
          "quantity",
          "depth",
          "units",
          "rate",
          "discountBp",
          "net",
          "taxRateUUID",
          "taxRateName",
          "taxRateBp",
          "tax",
          "details"
        ],
        "additionalProperties": false,
        "description": "A line on an invoice or credit note"
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the invoice"
          },
          "kind": {
            "type": "string",
            "enum": ["INVOICE", "DEPOSIT", "CREDIT_NOTE"],
            "description": "INVOICE for what's on the project, DEPOSIT for a share of it asked for up front, CREDIT_NOTE to cancel an issued invoice"
          },
          "status": {
            "type": "string",
            "enum": ["DRAFT", "ISSUED"],
            "description": "DRAFT can change. ISSUED is numbered and never changes"
          },
          "state": {
            "type": "string",
            "enum": [
              "DRAFT",
              "UNPAID",
              "PART_PAID",
              "PAID",
              "OVERDUE",
              "CREDITED"
            ],
            "description": "Where it's up to: DRAFT, UNPAID, PART_PAID, PAID, OVERDUE (past its due date and not paid) or CREDITED (cancelled by a full credit note). Credit notes are always PAID"
          },
          "number": {
            "description": "Its number, such as INV-0001. Null while it's a draft",
            "type": ["string", "null"]
          },
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project or sub-project it invoices, with its sub-projects"
          },
          "client": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the client"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the client"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The project's client now"
          },
          "billing": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Billing"
              },
              {
                "type": "null"
              }
            ]
          },
          "credits": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the invoice"
                  },
                  "number": {
                    "description": "The invoice's number",
                    "type": ["string", "null"]
                  }
                },
                "required": ["uuid", "number"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "For a credit note: the invoice it cancels or credits part of"
          },
          "creditedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the credit note"
                  },
                  "number": {
                    "description": "The credit note's number",
                    "type": ["string", "null"]
                  }
                },
                "required": ["uuid", "number"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The credit note that cancelled it, if any. Partial credit notes aren't this"
          },
          "depositBp": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "For a deposit invoice: the share of the project it asks for, in basis points. Null for a fixed amount"
          },
          "issuedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was issued"
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it's due to be paid"
          },
          "reference": {
            "description": "The client's purchase order or reference",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Printed on the invoice",
            "type": ["string", "null"]
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total before tax"
          },
          "tax": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total tax"
          },
          "gross": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total with tax"
          },
          "taxByRate": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxTotal"
            },
            "description": "Tax for each rate"
          },
          "paid": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Payments against it, less refunds. For a credit note, refunds"
          },
          "partial": {
            "type": "boolean",
            "description": "For a credit note: true if it credits only some of the invoice, which stays live"
          },
          "partlyCredited": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What partial credit notes have taken off it, with tax, as a positive amount"
          },
          "due": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's still to pay: gross less partly credited, less paid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was drafted"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          }
        },
        "required": [
          "uuid",
          "kind",
          "status",
          "state",
          "number",
          "project",
          "client",
          "billing",
          "credits",
          "creditedBy",
          "depositBp",
          "issuedAt",
          "dueAt",
          "reference",
          "notes",
          "net",
          "tax",
          "gross",
          "taxByRate",
          "paid",
          "partial",
          "partlyCredited",
          "due",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "An invoice, deposit invoice or credit note for a project. Amounts are in the smallest currency unit; a credit note's are negative"
      },
      "InvoiceDetail": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the invoice"
          },
          "kind": {
            "type": "string",
            "enum": ["INVOICE", "DEPOSIT", "CREDIT_NOTE"],
            "description": "INVOICE for what's on the project, DEPOSIT for a share of it asked for up front, CREDIT_NOTE to cancel an issued invoice"
          },
          "status": {
            "type": "string",
            "enum": ["DRAFT", "ISSUED"],
            "description": "DRAFT can change. ISSUED is numbered and never changes"
          },
          "state": {
            "type": "string",
            "enum": [
              "DRAFT",
              "UNPAID",
              "PART_PAID",
              "PAID",
              "OVERDUE",
              "CREDITED"
            ],
            "description": "Where it's up to: DRAFT, UNPAID, PART_PAID, PAID, OVERDUE (past its due date and not paid) or CREDITED (cancelled by a full credit note). Credit notes are always PAID"
          },
          "number": {
            "description": "Its number, such as INV-0001. Null while it's a draft",
            "type": ["string", "null"]
          },
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project or sub-project it invoices, with its sub-projects"
          },
          "client": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the client"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the client"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The project's client now"
          },
          "billing": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Billing"
              },
              {
                "type": "null"
              }
            ]
          },
          "credits": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the invoice"
                  },
                  "number": {
                    "description": "The invoice's number",
                    "type": ["string", "null"]
                  }
                },
                "required": ["uuid", "number"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "For a credit note: the invoice it cancels or credits part of"
          },
          "creditedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the credit note"
                  },
                  "number": {
                    "description": "The credit note's number",
                    "type": ["string", "null"]
                  }
                },
                "required": ["uuid", "number"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The credit note that cancelled it, if any. Partial credit notes aren't this"
          },
          "depositBp": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "For a deposit invoice: the share of the project it asks for, in basis points. Null for a fixed amount"
          },
          "issuedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was issued"
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it's due to be paid"
          },
          "reference": {
            "description": "The client's purchase order or reference",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Printed on the invoice",
            "type": ["string", "null"]
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total before tax"
          },
          "tax": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total tax"
          },
          "gross": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total with tax"
          },
          "taxByRate": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxTotal"
            },
            "description": "Tax for each rate"
          },
          "paid": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Payments against it, less refunds. For a credit note, refunds"
          },
          "partial": {
            "type": "boolean",
            "description": "For a credit note: true if it credits only some of the invoice, which stays live"
          },
          "partlyCredited": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What partial credit notes have taken off it, with tax, as a positive amount"
          },
          "due": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What's still to pay: gross less partly credited, less paid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was drafted"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "Unique identifier of the invoice line"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "LINE",
                    "ADJUSTMENT",
                    "DEPOSIT",
                    "DEPOSIT_DEDUCTION"
                  ],
                  "description": "LINE is a project line invoiced for the first time. ADJUSTMENT is what a project line changed by since it was last invoiced. DEPOSIT is part of the project's total at one tax rate. DEPOSIT_DEDUCTION takes an earlier deposit invoice off"
                },
                "projectLineUUID": {
                  "description": "UUID of the project line it invoices",
                  "type": ["string", "null"]
                },
                "depositInvoice": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the deposit invoice"
                        },
                        "number": {
                          "description": "The deposit invoice's number",
                          "type": ["string", "null"]
                        }
                      },
                      "required": ["uuid", "number"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "For DEPOSIT_DEDUCTION: the deposit invoice it takes off"
                },
                "projectName": {
                  "type": "string",
                  "description": "The project or sub-project it's on, for grouping"
                },
                "description": {
                  "type": "string",
                  "description": "What it's for. Empty for deposits and deductions"
                },
                "comment": {
                  "description": "The line's comment, or null",
                  "type": ["string", "null"]
                },
                "quantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many"
                },
                "depth": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "0 for a line, 1 for an accessory under it, and so on"
                },
                "units": {
                  "type": "number",
                  "description": "Chargeable units, such as days"
                },
                "rate": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Rate of one in the smallest currency unit, or null"
                },
                "discountBp": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Discount in basis points (1000 is 10%)"
                },
                "net": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Amount before tax"
                },
                "taxRateUUID": {
                  "description": "UUID of the tax rate",
                  "type": ["string", "null"]
                },
                "taxRateName": {
                  "type": "string",
                  "description": "The tax rate's name, or empty"
                },
                "taxRateBp": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Tax rate in basis points"
                },
                "tax": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Tax on the line"
                },
                "details": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DocumentDetail"
                  },
                  "description": "Custom field values printed under the line, such as a lantern's power, as they were when the line was drafted"
                },
                "creditable": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Net still to credit on this line with invoices.credit `lines`. 0 if it can't be credited on its own"
                }
              },
              "required": [
                "uuid",
                "kind",
                "projectLineUUID",
                "depositInvoice",
                "projectName",
                "description",
                "comment",
                "quantity",
                "depth",
                "units",
                "rate",
                "discountBp",
                "net",
                "taxRateUUID",
                "taxRateName",
                "taxRateBp",
                "tax",
                "details",
                "creditable"
              ],
              "additionalProperties": false
            },
            "description": "Its lines, in order"
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code"
          },
          "taxName": {
            "type": "string",
            "description": "What tax is called, such as VAT"
          }
        },
        "required": [
          "uuid",
          "kind",
          "status",
          "state",
          "number",
          "project",
          "client",
          "billing",
          "credits",
          "creditedBy",
          "depositBp",
          "issuedAt",
          "dueAt",
          "reference",
          "notes",
          "net",
          "tax",
          "gross",
          "taxByRate",
          "paid",
          "partial",
          "partlyCredited",
          "due",
          "createdAt",
          "updatedAt",
          "lines",
          "currency",
          "taxName"
        ],
        "additionalProperties": false,
        "description": "An invoice with its lines"
      },
      "QuoteLine": {
        "type": "object",
        "properties": {
          "projectName": {
            "type": "string",
            "description": "The project or sub-project it's on, for grouping"
          },
          "description": {
            "type": "string",
            "description": "What it's for"
          },
          "comment": {
            "description": "The line's comment, or null",
            "type": ["string", "null"]
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many"
          },
          "depth": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "0 for a line, 1 for an accessory under it, and so on"
          },
          "units": {
            "type": "number",
            "description": "Chargeable units, such as days"
          },
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Rate of one in the smallest currency unit, or null"
          },
          "discountBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Discount in basis points (1000 is 10%)"
          },
          "taxRateBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Tax rate in basis points"
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Amount before tax"
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentDetail"
            },
            "description": "Custom field values printed under the line, such as a lantern's power. Empty for quotes issued before they were printed"
          }
        },
        "required": [
          "projectName",
          "description",
          "comment",
          "quantity",
          "depth",
          "units",
          "rate",
          "discountBp",
          "taxRateBp",
          "net",
          "details"
        ],
        "additionalProperties": false,
        "description": "A line on a quote, as it was when the quote was issued"
      },
      "QuoteTotals": {
        "type": "object",
        "properties": {
          "hireSubtotal": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Before discounts"
          },
          "discounts": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Discounts, as one amount"
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total before tax"
          },
          "tax": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total tax"
          },
          "gross": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total with tax"
          },
          "taxByRate": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxTotal"
            },
            "description": "Tax for each rate"
          }
        },
        "required": [
          "hireSubtotal",
          "discounts",
          "net",
          "tax",
          "gross",
          "taxByRate"
        ],
        "additionalProperties": false,
        "description": "A quote's totals, as they were when it was issued"
      },
      "Quote": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the quote"
          },
          "number": {
            "type": "string",
            "description": "Its number, such as QUO-0001"
          },
          "version": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "1 for the project's first quote, 2 for the next, and so on"
          },
          "status": {
            "type": "string",
            "enum": ["ISSUED", "ACCEPTED", "DECLINED"],
            "description": "ISSUED, or ACCEPTED or DECLINED once the client answered"
          },
          "state": {
            "type": "string",
            "enum": ["ISSUED", "ACCEPTED", "DECLINED", "EXPIRED", "SUPERSEDED"],
            "description": "Where it's up to: as its status, or EXPIRED (past its valid date with no answer) or SUPERSEDED (a later version was issued with no answer to this one)"
          },
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project or sub-project it quotes for"
          },
          "billing": {
            "$ref": "#/components/schemas/Billing"
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was issued"
          },
          "validUntil": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it stops being valid, or null for no expiry"
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the client accepted or declined it"
          },
          "decidedByName": {
            "description": "Who at the client accepted or declined it",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Printed on the quote",
            "type": ["string", "null"]
          },
          "totals": {
            "$ref": "#/components/schemas/QuoteTotals"
          },
          "changedSince": {
            "type": "boolean",
            "description": "True when the project's total now differs from this quote's, so it may need quoting again"
          },
          "issuedByUUID": {
            "description": "UUID of the member who issued it",
            "type": ["string", "null"]
          },
          "decidedOnline": {
            "type": "boolean",
            "description": "True if the client answered through the quote's link, rather than a member recording it"
          },
          "decisionComment": {
            "description": "What the client wrote when they answered through the link",
            "type": ["string", "null"]
          },
          "linkShared": {
            "type": "boolean",
            "description": "True if the quote has a link the client can open to see and answer it. Get it with quotes.share"
          }
        },
        "required": [
          "uuid",
          "number",
          "version",
          "status",
          "state",
          "project",
          "billing",
          "issuedAt",
          "validUntil",
          "decidedAt",
          "decidedByName",
          "notes",
          "totals",
          "changedSince",
          "issuedByUUID",
          "decidedOnline",
          "decisionComment",
          "linkShared"
        ],
        "additionalProperties": false,
        "description": "A quote sent for a project: its lines and totals frozen when it was issued. Amounts are in the smallest currency unit"
      },
      "QuoteDetail": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the quote"
          },
          "number": {
            "type": "string",
            "description": "Its number, such as QUO-0001"
          },
          "version": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "1 for the project's first quote, 2 for the next, and so on"
          },
          "status": {
            "type": "string",
            "enum": ["ISSUED", "ACCEPTED", "DECLINED"],
            "description": "ISSUED, or ACCEPTED or DECLINED once the client answered"
          },
          "state": {
            "type": "string",
            "enum": ["ISSUED", "ACCEPTED", "DECLINED", "EXPIRED", "SUPERSEDED"],
            "description": "Where it's up to: as its status, or EXPIRED (past its valid date with no answer) or SUPERSEDED (a later version was issued with no answer to this one)"
          },
          "project": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the project"
              },
              "number": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The project's number"
              },
              "name": {
                "type": "string",
                "description": "The project's name"
              }
            },
            "required": ["uuid", "number", "name"],
            "additionalProperties": false,
            "description": "The project or sub-project it quotes for"
          },
          "billing": {
            "$ref": "#/components/schemas/Billing"
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was issued"
          },
          "validUntil": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it stops being valid, or null for no expiry"
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the client accepted or declined it"
          },
          "decidedByName": {
            "description": "Who at the client accepted or declined it",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Printed on the quote",
            "type": ["string", "null"]
          },
          "totals": {
            "$ref": "#/components/schemas/QuoteTotals"
          },
          "changedSince": {
            "type": "boolean",
            "description": "True when the project's total now differs from this quote's, so it may need quoting again"
          },
          "issuedByUUID": {
            "description": "UUID of the member who issued it",
            "type": ["string", "null"]
          },
          "decidedOnline": {
            "type": "boolean",
            "description": "True if the client answered through the quote's link, rather than a member recording it"
          },
          "decisionComment": {
            "description": "What the client wrote when they answered through the link",
            "type": ["string", "null"]
          },
          "linkShared": {
            "type": "boolean",
            "description": "True if the quote has a link the client can open to see and answer it. Get it with quotes.share"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuoteLine"
            },
            "description": "Its lines, in order"
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code"
          },
          "taxName": {
            "type": "string",
            "description": "What tax is called, such as VAT"
          }
        },
        "required": [
          "uuid",
          "number",
          "version",
          "status",
          "state",
          "project",
          "billing",
          "issuedAt",
          "validUntil",
          "decidedAt",
          "decidedByName",
          "notes",
          "totals",
          "changedSince",
          "issuedByUUID",
          "decidedOnline",
          "decisionComment",
          "linkShared",
          "lines",
          "currency",
          "taxName"
        ],
        "additionalProperties": false,
        "description": "A quote with its lines"
      },
      "AssetImportCheckOutput": {
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "row": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Index of the row in `rows`"
                },
                "action": {
                  "type": "string",
                  "enum": ["CREATE", "UPDATE", "SKIP", "ERROR"],
                  "description": "What importing the row does: CREATE an asset, UPDATE an existing one, SKIP it (its asset ID exists, or nothing would change), or nothing because of an ERROR in `issues`"
                },
                "issues": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AssetImportIssue"
                  },
                  "description": "Problems to fix. Empty if none"
                },
                "assetUUID": {
                  "description": "UUID of the existing asset with the row's asset ID, or null",
                  "type": ["string", "null"]
                },
                "assetType": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "description": "UUID of the asset type, or null if the import will create it",
                          "type": ["string", "null"]
                        },
                        "name": {
                          "type": "string",
                          "description": "The asset type's name (for a category, its path)"
                        },
                        "isNew": {
                          "type": "boolean",
                          "description": "Whether the import will create the asset type"
                        }
                      },
                      "required": ["uuid", "name", "isNew"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "category": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "description": "UUID of the category, or null if the import will create it",
                          "type": ["string", "null"]
                        },
                        "name": {
                          "type": "string",
                          "description": "The category's name (for a category, its path)"
                        },
                        "isNew": {
                          "type": "boolean",
                          "description": "Whether the import will create the category"
                        }
                      },
                      "required": ["uuid", "name", "isNew"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "manufacturer": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "description": "UUID of the manufacturer, or null if the import will create it",
                          "type": ["string", "null"]
                        },
                        "name": {
                          "type": "string",
                          "description": "The manufacturer's name (for a category, its path)"
                        },
                        "isNew": {
                          "type": "boolean",
                          "description": "Whether the import will create the manufacturer"
                        }
                      },
                      "required": ["uuid", "name", "isNew"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "location": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": ["string", "null"]
                        },
                        "name": {
                          "type": "string"
                        },
                        "isNew": {
                          "type": "boolean"
                        }
                      },
                      "required": ["uuid", "name", "isNew"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The location the asset will be kept at, or null"
                },
                "changes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "UPDATE: the row fields that will change"
                }
              },
              "required": [
                "row",
                "action",
                "issues",
                "assetUUID",
                "assetType",
                "category",
                "manufacturer",
                "location",
                "changes"
              ],
              "additionalProperties": false
            },
            "description": "Each row, in order"
          },
          "summary": {
            "type": "object",
            "properties": {
              "create": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Rows that create an asset"
              },
              "update": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Rows that update an asset"
              },
              "skip": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Rows skipped"
              },
              "error": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Rows with issues to fix"
              }
            },
            "required": ["create", "update", "skip", "error"],
            "additionalProperties": false,
            "description": "How many rows do what"
          },
          "newCategories": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Paths of the categories the import will create"
          },
          "newLocations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Paths of the locations the import will create"
          },
          "newManufacturers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the manufacturers the import will create"
          },
          "newAssetTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the asset types the import will create"
          }
        },
        "required": [
          "rows",
          "summary",
          "newCategories",
          "newLocations",
          "newManufacturers",
          "newAssetTypes"
        ],
        "additionalProperties": false
      },
      "AssetImportRunOutput": {
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "row": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Index of the row in `rows`"
                },
                "outcome": {
                  "type": "string",
                  "enum": ["CREATED", "UPDATED", "SKIPPED", "FAILED"],
                  "description": "What happened to the row"
                },
                "assetUUID": {
                  "description": "UUID of the asset created or updated, or null",
                  "type": ["string", "null"]
                },
                "primaryID": {
                  "description": "The asset's primary asset ID, or null",
                  "type": ["string", "null"]
                },
                "issues": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AssetImportIssue"
                  },
                  "description": "FAILED: why"
                }
              },
              "required": [
                "row",
                "outcome",
                "assetUUID",
                "primaryID",
                "issues"
              ],
              "additionalProperties": false
            },
            "description": "Each row, in order"
          },
          "summary": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Assets created"
              },
              "updated": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Assets updated"
              },
              "skipped": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Rows skipped"
              },
              "failed": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Rows not imported"
              },
              "categoriesCreated": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Categories created"
              },
              "manufacturersCreated": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Manufacturers created"
              },
              "locationsCreated": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Locations created"
              },
              "assetTypesCreated": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Asset types created"
              }
            },
            "required": [
              "created",
              "updated",
              "skipped",
              "failed",
              "categoriesCreated",
              "manufacturersCreated",
              "locationsCreated",
              "assetTypesCreated"
            ],
            "additionalProperties": false,
            "description": "What the import did"
          }
        },
        "required": ["rows", "summary"],
        "additionalProperties": false
      },
      "AssetCategoriesListOutput": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetCategoryTreeNode"
            },
            "description": "Top-level categories on this page, each with its children. Children are sorted the same way"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of top-level categories across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          },
          "offset": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position of this page's first category among all the top-level categories, 0-based"
          }
        },
        "required": [
          "categories",
          "total",
          "nextCursor",
          "previousCursor",
          "offset"
        ],
        "additionalProperties": false
      },
      "AssetCategoriesDeleteOutput": {
        "type": "object",
        "properties": {
          "deletedCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of categories deleted, including nested ones"
          }
        },
        "required": ["deletedCount"],
        "additionalProperties": false
      },
      "AttachmentsListOutput": {
        "type": "object",
        "properties": {
          "folders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttachmentFolder"
            },
            "description": "Every folder on the record, by name. Build the tree from `parentUUID`"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttachedFile"
            },
            "description": "Every file and link on the record, by name. Place them with `folderUUID`"
          }
        },
        "required": ["folders", "files"],
        "additionalProperties": false
      },
      "AttachmentsDeleteFolderOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted folder"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "AttachmentsStartUploadOutput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "description": "Identifies this upload. Pass it to `attachments.finish-upload` once the bytes are sent"
          },
          "uploadUrl": {
            "type": "string",
            "description": "Path to PUT the file's bytes to, relative to the site. Anyone holding it can upload to it until the upload is finished or expires, so keep it private. For a multipart upload, PUT each part to it with `?partNumber=N` (1-based) and keep each response's `ETag`"
          },
          "multipart": {
            "type": "boolean",
            "description": "Whether the file must be sent in parts of `partSizeBytes` (the last part may be smaller)"
          },
          "partSizeBytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Size of each part, for a multipart upload"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the upload URL stops working"
          }
        },
        "required": [
          "uploadToken",
          "uploadUrl",
          "multipart",
          "partSizeBytes",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "AttachmentsDeleteFileOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the file moved to the trash"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "LocationsListOutput": {
        "type": "object",
        "properties": {
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationTreeNode"
            },
            "description": "Top-level locations on this page, each with the locations inside it. Those are sorted the same way"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of top-level locations across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["locations", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "LocationsGetOutput": {
        "type": "object",
        "properties": {
          "location": {
            "$ref": "#/components/schemas/Location"
          },
          "path": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the location"
                },
                "name": {
                  "type": "string",
                  "description": "Display name"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "The locations it is inside, outermost first"
          }
        },
        "required": ["location", "path"],
        "additionalProperties": false
      },
      "LocationsDeleteOutput": {
        "type": "object",
        "properties": {
          "deletedCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of locations deleted, including those inside it"
          }
        },
        "required": ["deletedCount"],
        "additionalProperties": false
      },
      "ClientsListOutput": {
        "type": "object",
        "properties": {
          "clients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Client"
            },
            "description": "Clients on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of clients across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["clients", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ClientsGetOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the client"
          },
          "name": {
            "type": "string",
            "description": "Name of the business or person"
          },
          "parentUUID": {
            "description": "UUID of the client this one sits under (e.g. a company within a group), or null for a top-level client",
            "type": ["string", "null"]
          },
          "website": {
            "description": "Website address",
            "type": ["string", "null"]
          },
          "clientPricingUUID": {
            "description": "UUID of the client pricing its new projects use, or null for catalogue prices. Set with clients.set-pricing",
            "type": ["string", "null"]
          },
          "address": {
            "description": "Postal address; lines are separated by newlines",
            "type": ["string", "null"]
          },
          "notes": {
            "description": "Free-text notes about the client",
            "type": ["string", "null"]
          },
          "taxExempt": {
            "type": "boolean",
            "description": "Projects for this client charge no tax, such as for a charity with relief or a client abroad"
          },
          "isSupplier": {
            "type": "boolean",
            "description": "The organisation also hires from this client, so it can be picked as a sub-hire supplier"
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the client was archived, or null if it is active. Archived clients can't be picked for new work"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the client was soft-deleted, or null if it is live"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the client was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the client last changed"
          },
          "path": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the client"
                },
                "name": {
                  "type": "string",
                  "description": "Name of the client"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "The clients this one sits under, outermost first. Empty for a top-level client"
          }
        },
        "required": [
          "uuid",
          "name",
          "parentUUID",
          "website",
          "clientPricingUUID",
          "address",
          "notes",
          "taxExempt",
          "isSupplier",
          "archivedAt",
          "deletedAt",
          "createdAt",
          "updatedAt",
          "path"
        ],
        "additionalProperties": false
      },
      "ClientsTimelineOutput": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "The organisation's currency code"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientTimelineEntry"
            },
            "description": "What happened with the client, newest first"
          },
          "nextCursor": {
            "description": "Pass as cursor to read older entries, or null at the end",
            "type": ["string", "null"]
          }
        },
        "required": ["currency", "entries", "nextCursor"],
        "additionalProperties": false
      },
      "ClientsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted client"
          },
          "deletedCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of clients deleted, including nested ones"
          }
        },
        "required": ["uuid", "deletedCount"],
        "additionalProperties": false
      },
      "ClientContactsListOutput": {
        "type": "object",
        "properties": {
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientContact"
            },
            "description": "Contacts on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of contacts across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["contacts", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ClientContactsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the removed contact"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "ManufacturersListOutput": {
        "type": "object",
        "properties": {
          "manufacturers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManufacturerTreeNode"
            },
            "description": "Top-level manufacturers on this page, in the order asked for, each with the manufacturers it owns"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of manufacturers across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["manufacturers", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ManufacturersDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the manufacturer that was deleted"
          },
          "movedToTopLevel": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of manufacturers it owned, which are now top-level rather than deleted"
          }
        },
        "required": ["uuid", "movedToTopLevel"],
        "additionalProperties": false
      },
      "AssetTypesListOutput": {
        "type": "object",
        "properties": {
          "assetTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetType"
            },
            "description": "Asset types on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of asset types across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["assetTypes", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "AssetTypesSetTrackingOutput": {
        "type": "object",
        "properties": {
          "assetType": {
            "description": "The asset type, as it is now",
            "$ref": "#/components/schemas/AssetType"
          },
          "changed": {
            "type": "boolean",
            "description": "Whether the tracking changed. False for a preview, or when it was already tracked that way"
          },
          "assetsBefore": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many assets (units or lots) the type had before"
          },
          "assetsAfter": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many assets it has after: one lot for each set of alike units when going to BULK, one unit for each item when going to INDIVIDUAL"
          },
          "emptyLotsDeleted": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Lots holding none, which are deleted when going to INDIVIDUAL"
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "OPEN_MAINTENANCE",
                    "ON_PROJECT",
                    "HAS_CONTENTS",
                    "CONSUMABLE",
                    "TOO_MANY_UNITS",
                    "PLAN_LIMIT"
                  ],
                  "description": "What stops it: OPEN_MAINTENANCE (on an open maintenance job), ON_PROJECT (on a project that hasn't finished or been lost), HAS_CONTENTS (a unit with assets inside it), CONSUMABLE (consumables are bulk only), TOO_MANY_UNITS (more than 1,000 units would be made) or PLAN_LIMIT (the plan doesn't allow that many assets)"
                },
                "assetIDs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Asset IDs of up to 10 of the assets affected"
                },
                "count": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many assets are affected, or for PLAN_LIMIT how many would be added"
                }
              },
              "required": ["code", "assetIDs", "count"],
              "additionalProperties": false
            },
            "description": "What has to change first. Empty when nothing stops it"
          }
        },
        "required": [
          "assetType",
          "changed",
          "assetsBefore",
          "assetsAfter",
          "emptyLotsDeleted",
          "blockers"
        ],
        "additionalProperties": false
      },
      "AssetTypesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the asset type that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "AssetTypesAddThumbnailOutput": {
        "type": "object",
        "properties": {
          "thumbnailUUID": {
            "type": "string",
            "description": "UUID of the thumbnail that was added"
          },
          "assetType": {
            "description": "The asset type, with the thumbnail",
            "$ref": "#/components/schemas/AssetType"
          }
        },
        "required": ["thumbnailUUID", "assetType"],
        "additionalProperties": false
      },
      "PackagesListOutput": {
        "type": "object",
        "properties": {
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PackageSummary"
            },
            "description": "Packages on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of packages across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["packages", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "PackagesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the package that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "CalendarProjectsOutput": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarEvent"
            },
            "description": "Projects in the period, earliest first"
          },
          "timezone": {
            "type": "string",
            "description": "IANA name of the organisation's timezone, which `from` and `to` are in"
          },
          "truncated": {
            "type": "boolean",
            "description": "true if there were more than 2000 projects, and only the first 2000 came back. Ask for a shorter period"
          }
        },
        "required": ["events", "timezone", "truncated"],
        "additionalProperties": false
      },
      "CalendarMineOutput": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MyCalendarEvent"
            },
            "description": "The caller's projects in the period, earliest first"
          },
          "timezone": {
            "type": "string",
            "description": "IANA name of the organisation's timezone, which `from` and `to` are in"
          },
          "truncated": {
            "type": "boolean",
            "description": "true if there were more than 2000 projects, and only the first 2000 came back. Ask for a shorter period"
          }
        },
        "required": ["events", "timezone", "truncated"],
        "additionalProperties": false
      },
      "CalendarMemberOutput": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MyCalendarEvent"
            },
            "description": "The member's projects in the period, earliest first. `reasons` is `MANAGER` or `CREW`: who follows a project isn't shown"
          },
          "timezone": {
            "type": "string",
            "description": "IANA name of the organisation's timezone, which `from` and `to` are in"
          },
          "truncated": {
            "type": "boolean",
            "description": "true if there were more than 2000 projects, and only the first 2000 came back. Ask for a shorter period"
          }
        },
        "required": ["events", "timezone", "truncated"],
        "additionalProperties": false
      },
      "CalendarSettingsGetOutput": {
        "type": "object",
        "properties": {
          "showStatus": {
            "type": "boolean",
            "description": "Show each project's status after its name"
          },
          "showSubProjects": {
            "type": "boolean",
            "description": "Show sub-projects with dates of their own as entries of their own. Sub-projects using their parent's dates are always left out"
          },
          "defaultView": {
            "type": "string",
            "enum": ["month", "week", "list"],
            "description": "How the calendar opens: `month`, `week`, or `list` for the month's projects as a list"
          },
          "useWeekLabels": {
            "type": "boolean",
            "description": "Show the week labels in place of week numbers"
          },
          "weekLabels": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarWeekLabel"
            },
            "description": "Names for weeks, earliest first"
          },
          "timezone": {
            "type": "string",
            "description": "IANA name of the organisation's timezone, which the calendar's days are in. Set in the localisation settings"
          }
        },
        "required": [
          "showStatus",
          "showSubProjects",
          "defaultView",
          "useWeekLabels",
          "weekLabels",
          "timezone"
        ],
        "additionalProperties": false
      },
      "CalendarFeedsGetOutput": {
        "type": "object",
        "properties": {
          "feed": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CalendarFeed"
              },
              {
                "type": "null"
              }
            ],
            "description": "The caller's feed, or null if they haven't made one"
          }
        },
        "required": ["feed"],
        "additionalProperties": false
      },
      "CalendarFeedsCreateOutput": {
        "type": "object",
        "properties": {
          "feed": {
            "$ref": "#/components/schemas/CalendarFeed"
          },
          "path": {
            "type": "string",
            "description": "The feed's address, from the AdamRMS host: `/api/v1/calendar/{organisationUUID}/{token}.ics`. Shown only now. Anyone with it can read the feed"
          }
        },
        "required": ["feed", "path"],
        "additionalProperties": false
      },
      "CalendarFeedsRevokeOutput": {
        "type": "object",
        "properties": {
          "revoked": {
            "type": "boolean",
            "description": "true if there was a feed, which no longer works"
          }
        },
        "required": ["revoked"],
        "additionalProperties": false
      },
      "DashboardSetWidgetsOutput": {
        "type": "object",
        "properties": {
          "hidden": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "my-calendar",
                "projects-today",
                "project-shortages",
                "my-maintenance",
                "maintenance-open",
                "inspections-due",
                "inventory-total",
                "inventory-value",
                "members",
                "storage"
              ],
              "description": "A widget: `my-calendar`, `projects-today`, `project-shortages`, `my-maintenance`, `maintenance-open`, `inspections-due`, `inventory-total`, `inventory-value`, `members` or `storage`"
            },
            "description": "The widgets the caller now hides"
          }
        },
        "required": ["hidden"],
        "additionalProperties": false
      },
      "WikiPagesListOutput": {
        "type": "object",
        "properties": {
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WikiPage"
            },
            "description": "Pages the caller can see on this page of results"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of pages across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["pages", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "WikiPagesListRevisionsOutput": {
        "type": "object",
        "properties": {
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WikiRevisionSummary"
            },
            "description": "Revisions on this page of results"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of revisions across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["revisions", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "WikiPagesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the page that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "WikiPagesRecordViewOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the page"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "WikiPagesViewStatsOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the page"
          },
          "views": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Views in the period"
          },
          "viewers": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Different members who viewed it in the period"
          },
          "byDay": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "The day, in UTC"
                },
                "views": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Views that day"
                }
              },
              "required": ["date", "views"],
              "additionalProperties": false
            },
            "description": "Views per day, oldest first, including days with none"
          },
          "bySource": {
            "type": "object",
            "properties": {
              "WEB": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Views on the page itself"
              },
              "APP": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Views in a mobile app"
              },
              "DASHBOARD": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Views as a role's dashboard"
              }
            },
            "required": ["WEB", "APP", "DASHBOARD"],
            "additionalProperties": false,
            "description": "Views in the period by where they happened"
          }
        },
        "required": ["uuid", "views", "viewers", "byDay", "bySource"],
        "additionalProperties": false
      },
      "WikiPagesListViewsOutput": {
        "type": "object",
        "properties": {
          "views": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "userUUID": {
                  "description": "UUID of the member who viewed the page, or null if not known",
                  "type": ["string", "null"]
                },
                "userName": {
                  "description": "Name of the member, or null if not known",
                  "type": ["string", "null"]
                },
                "source": {
                  "type": "string",
                  "enum": ["WEB", "APP", "DASHBOARD"],
                  "description": "Where it was viewed: `WEB` on its own page, `APP` in a mobile app, `DASHBOARD` as a role's dashboard"
                },
                "viewedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When"
                }
              },
              "required": ["userUUID", "userName", "source", "viewedAt"],
              "additionalProperties": false,
              "description": "One view of a wiki page"
            },
            "description": "Views on this page of results"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of views across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["views", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "WikiPagesListDashboardsOutput": {
        "type": "object",
        "properties": {
          "dashboards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WikiPagesSetDashboardOutput"
            },
            "description": "Every role in the organisation, with its dashboard"
          }
        },
        "required": ["dashboards"],
        "additionalProperties": false
      },
      "WikiPagesSetDashboardOutput": {
        "type": "object",
        "properties": {
          "role": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the role"
              },
              "name": {
                "type": "string",
                "description": "The role's name"
              },
              "custom": {
                "type": "boolean",
                "description": "Whether it is one of the organisation's own roles, rather than a built-in one"
              }
            },
            "required": ["uuid", "name", "custom"],
            "additionalProperties": false
          },
          "page": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the page"
                  },
                  "name": {
                    "type": "string",
                    "description": "The page's title"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The wiki page the role's members see in place of the dashboard, or null for the usual dashboard"
          }
        },
        "required": ["role", "page"],
        "additionalProperties": false
      },
      "WikiPagesGetDashboardOutput": {
        "type": "object",
        "properties": {
          "page": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WikiPageWithContent"
              },
              {
                "type": "null"
              }
            ],
            "description": "The wiki page the caller's role shows in place of the dashboard, with its newest content, or null for the usual dashboard"
          }
        },
        "required": ["page"],
        "additionalProperties": false
      },
      "AssetGroupsListOutput": {
        "type": "object",
        "properties": {
          "assetGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetGroup"
            },
            "description": "Groups on this page, in the order asked for: the organisation's shared groups and the caller's own personal ones"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of asset groups across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["assetGroups", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "AssetGroupsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the group that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "AssetGroupsAddAssetsOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the asset group"
          },
          "count": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many assets were added or removed. Assets already in the group (or already out of it) aren't counted"
          }
        },
        "required": ["uuid", "count"],
        "additionalProperties": false
      },
      "NotificationsSendOutput": {
        "type": "object",
        "properties": {
          "emailed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many members were emailed. The rest were skipped: not members, unable to see the record, or with these emails turned off"
          }
        },
        "required": ["emailed"],
        "additionalProperties": false
      },
      "LabelTemplatesListOutput": {
        "type": "object",
        "properties": {
          "labelTemplates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelTemplate"
            },
            "description": "Templates on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of label templates across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["labelTemplates", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "LabelTemplatesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the template that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "AssetsListOutput": {
        "type": "object",
        "properties": {
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Asset"
            },
            "description": "Assets on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of assets across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["assets", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "AssetsCreateOutput": {
        "type": "object",
        "properties": {
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Asset"
            },
            "description": "The assets created, in order"
          }
        },
        "required": ["assets"],
        "additionalProperties": false
      },
      "AssetsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the asset that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "AssetIdsLookupOutput": {
        "type": "object",
        "properties": {
          "asset": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Asset"
              },
              {
                "type": "null"
              }
            ],
            "description": "The live asset with that ID, or null if there is none"
          }
        },
        "required": ["asset"],
        "additionalProperties": false
      },
      "AssetIdsReserveOutput": {
        "type": "object",
        "properties": {
          "assetIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The reserved asset IDs, in order. Print them as blank labels, then give one to an asset with `asset-ids.add` or `assets.create`"
          }
        },
        "required": ["assetIDs"],
        "additionalProperties": false
      },
      "AssetsStockHistoryOutput": {
        "type": "object",
        "properties": {
          "movements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockMovement"
            },
            "description": "Changes to the lot's quantity on this page"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of stock movements across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["movements", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "BackupsGetScheduleOutput": {
        "type": "object",
        "properties": {
          "hourUTC": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The hour of the day (0 to 23, UTC) the daily backup runs, or null if no daily backup is set up"
          },
          "nextBackupAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the next daily backup runs, or null if none is set up"
          }
        },
        "required": ["hourUTC", "nextBackupAt"],
        "additionalProperties": false
      },
      "BackupsCreateOutput": {
        "type": "object",
        "properties": {
          "backupId": {
            "type": "string",
            "description": "Name of the new backup. It is listed with `files.list` in the `DATABASE_BACKUPS` category"
          }
        },
        "required": ["backupId"],
        "additionalProperties": false
      },
      "AuditLogsListOutput": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEvent"
            },
            "description": "Events on this page, newest first"
          },
          "nextBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass as `before` for the next page. Null on the last page"
          }
        },
        "required": ["events", "nextBefore"],
        "additionalProperties": false
      },
      "SearchQueryOutput": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            },
            "description": "What matched, best match first"
          }
        },
        "required": ["results"],
        "additionalProperties": false
      },
      "AiUsageGetAllowanceOutput": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "description": "The month the current allowance started in, as YYYY-MM. Allowances run from the subscription's billing day, so see periodStart and resetsOn"
          },
          "periodStart": {
            "type": "string",
            "description": "The day (UTC) the current month of allowance started, as YYYY-MM-DD: the subscription's billing day"
          },
          "resetsOn": {
            "type": "string",
            "description": "The day (UTC) the allowance starts again, as YYYY-MM-DD"
          },
          "currency": {
            "description": "The currency of the amounts, such as GBP: the organisation's subscription's. Null when usage can't be shown in money, such as on a complimentary subscription",
            "type": ["string", "null"]
          },
          "usedAmount": {
            "description": "What the organisation's AdamRMS AI use this month is worth, in the smallest unit of the currency (pence or cents). Null without a currency",
            "type": ["number", "null"]
          },
          "includedAmount": {
            "description": "What the organisation's plan includes each month, in the smallest unit of the currency. Null when unlimited, or without a currency",
            "type": ["number", "null"]
          },
          "unlimited": {
            "type": "boolean",
            "description": "Whether the organisation's plan includes unlimited AdamRMS AI"
          },
          "usedPercent": {
            "description": "How much of the plan's monthly allowance is used, as a percentage. Null when unlimited or none is included",
            "type": ["number", "null"]
          },
          "trialling": {
            "type": "boolean",
            "description": "Whether the organisation's subscription is in its free trial"
          },
          "canPrompt": {
            "type": "boolean",
            "description": "Whether members can send AdamRMS AI another prompt this month"
          },
          "stopReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["allowance", "trial"]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why AdamRMS AI has stopped for the month: allowance (the plan's allowance is used) or trial (the trial's allowance is used). Null while it can be used"
          }
        },
        "required": [
          "month",
          "periodStart",
          "resetsOn",
          "currency",
          "usedAmount",
          "includedAmount",
          "unlimited",
          "usedPercent",
          "trialling",
          "canPrompt",
          "stopReason"
        ],
        "additionalProperties": false
      },
      "PriceStructuresListOutput": {
        "type": "object",
        "properties": {
          "priceStructures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceStructure"
            },
            "description": "Price structures on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of price structures across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": [
          "priceStructures",
          "total",
          "nextCursor",
          "previousCursor"
        ],
        "additionalProperties": false
      },
      "PriceStructuresDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the price structure that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "TaxRatesListOutput": {
        "type": "object",
        "properties": {
          "taxRates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxRate"
            },
            "description": "Tax rates on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of tax rates across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["taxRates", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "TaxRatesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted tax rate"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "TaxRatesAddPresetOutput": {
        "type": "object",
        "properties": {
          "taxRates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxRate"
            },
            "description": "Every tax rate, after adding"
          },
          "taxName": {
            "type": "string",
            "description": "What tax is called, after adding"
          }
        },
        "required": ["taxRates", "taxName"],
        "additionalProperties": false
      },
      "ServicesListOutput": {
        "type": "object",
        "properties": {
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Service"
            },
            "description": "Services on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of services across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["services", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ServicesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the service that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "CrewRolesListOutput": {
        "type": "object",
        "properties": {
          "crewRoles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrewRole"
            },
            "description": "Crew roles on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of crew roles across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["crewRoles", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "CrewRolesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the crew role that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "ProjectTemplatesListOutput": {
        "type": "object",
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectTemplate"
            },
            "description": "Templates on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of templates across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["templates", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ProjectTemplatesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the template that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "ProjectLinesListOutput": {
        "type": "object",
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectLine"
            },
            "description": "Every line, in quote order: each line, then the lines under it. Sub-projects' lines follow the project's"
          },
          "totals": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectTotals"
              },
              {
                "type": "null"
              }
            ],
            "description": "The project's totals, or null if you can't see prices"
          },
          "outStart": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the project's assets leave, which availability is for"
          },
          "outEnd": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the project's assets are back"
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 code of the currency the amounts are in, e.g. `GBP`"
          },
          "taxName": {
            "type": "string",
            "description": "What the organisation calls tax on its documents, e.g. `VAT`"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectLineGroup"
            },
            "description": "Every group of lines, by `groupBy`, with what each needs. Counted over all the lines, whatever `groups`, search and filter return"
          },
          "counts": {
            "$ref": "#/components/schemas/ProjectLineCounts"
          }
        },
        "required": [
          "lines",
          "totals",
          "outStart",
          "outEnd",
          "currency",
          "taxName",
          "groups",
          "counts"
        ],
        "additionalProperties": false
      },
      "ProjectLinesAddOutput": {
        "type": "object",
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectLine"
            },
            "description": "The line added, then the lines added under it"
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "description": "UUID of the asset left out"
                },
                "reason": {
                  "type": "string",
                  "description": "Why: ASSET_BLOCKED, ASSET_UNAVAILABLE or ALREADY_ON_PROJECT"
                }
              },
              "required": ["assetUUID", "reason"],
              "additionalProperties": false
            },
            "description": "Assets in a case that couldn't be allocated with it, because they're out elsewhere or blocked"
          }
        },
        "required": ["lines", "skipped"],
        "additionalProperties": false
      },
      "ProjectLinesAddGroupOutput": {
        "type": "object",
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectLine"
            },
            "description": "The lines added, each asset's line followed by the lines added under it"
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "description": "UUID of the asset left out"
                },
                "reason": {
                  "type": "string",
                  "description": "Why: ASSET_BLOCKED, ASSET_UNAVAILABLE, ALREADY_ON_PROJECT or ASSET_NOT_FOUND"
                }
              },
              "required": ["assetUUID", "reason"],
              "additionalProperties": false
            },
            "description": "The group's assets that couldn't be added, and assets in its cases that couldn't go with them"
          }
        },
        "required": ["lines", "skipped"],
        "additionalProperties": false
      },
      "ProjectLinesRemoveOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the line removed"
          },
          "removed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many lines went, including those under it"
          }
        },
        "required": ["uuid", "removed"],
        "additionalProperties": false
      },
      "ProjectLinesRefreshPricesOutput": {
        "type": "object",
        "properties": {
          "changed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many lines changed price"
          }
        },
        "required": ["changed"],
        "additionalProperties": false
      },
      "ProjectAllocationsAllocateManyOutput": {
        "type": "object",
        "properties": {
          "line": {
            "description": "The line, with its allocations",
            "$ref": "#/components/schemas/ProjectLine"
          },
          "allocated": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the assets allocated"
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "description": "UUID of the asset left out"
                },
                "reason": {
                  "type": "string",
                  "description": "Why: ASSET_NOT_FOUND, WRONG_TYPE, ALREADY_ON_PROJECT, ASSET_BLOCKED, ASSET_UNAVAILABLE or TOO_MANY_FOR_LOT"
                }
              },
              "required": ["assetUUID", "reason"],
              "additionalProperties": false
            },
            "description": "Assets that couldn't be allocated. The rest still are"
          }
        },
        "required": ["line", "allocated", "skipped"],
        "additionalProperties": false
      },
      "ProjectLinesFreeAssetsOutput": {
        "type": "object",
        "properties": {
          "line": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the line"
              },
              "description": {
                "type": "string",
                "description": "What the line is"
              },
              "assetTypeUUID": {
                "type": "string",
                "description": "UUID of the line's asset type"
              },
              "tracking": {
                "type": "string",
                "enum": ["INDIVIDUAL", "BULK"],
                "description": "Whether the type is tracked unit by unit or in lots"
              },
              "quantity": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "How many the line is for"
              },
              "allocated": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "How many are allocated"
              },
              "toAllocate": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "How many more it needs, after what's hired in"
              }
            },
            "required": [
              "uuid",
              "description",
              "assetTypeUUID",
              "tracking",
              "quantity",
              "allocated",
              "toAllocate"
            ],
            "additionalProperties": false,
            "description": "The line being filled"
          },
          "start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Start of the period the assets are needed for, or null"
          },
          "end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "End of that period, or null"
          },
          "free": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "description": "UUID of the asset"
                },
                "assetId": {
                  "description": "The asset's primary asset ID, such as its barcode, or null",
                  "type": ["string", "null"]
                },
                "quantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many are free: 1 for a unit, some of a lot"
                },
                "location": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the location"
                        },
                        "name": {
                          "type": "string",
                          "description": "The location's name"
                        }
                      },
                      "required": ["uuid", "name"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Where it's kept, or null"
                },
                "lastInspectedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it was last inspected, or null"
                },
                "inspectionDueAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it's next due an inspection, if that's before the period ends, or null"
                },
                "flagged": {
                  "description": "Why it's flagged, such as an open maintenance job's title, or null. It can still be booked",
                  "type": ["string", "null"]
                }
              },
              "required": [
                "assetUUID",
                "assetId",
                "quantity",
                "location",
                "lastInspectedAt",
                "inspectionDueAt",
                "flagged"
              ],
              "additionalProperties": false
            },
            "description": "Assets of the type free for the whole period, by asset ID. At most 500"
          },
          "freeCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many assets are free in all"
          },
          "busy": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "description": "UUID of the asset"
                },
                "assetId": {
                  "description": "The asset's primary asset ID, such as its barcode, or null",
                  "type": ["string", "null"]
                },
                "reason": {
                  "type": "string",
                  "enum": ["ON_PROJECT", "ON_THIS_PROJECT", "BLOCKED"],
                  "description": "ON_PROJECT (on another confirmed project at the same time), ON_THIS_PROJECT (on another line of this project) or BLOCKED (maintenance or an overdue inspection)"
                },
                "project": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the project"
                        },
                        "number": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "The project's number"
                        },
                        "name": {
                          "type": "string",
                          "description": "The project's name"
                        }
                      },
                      "required": ["uuid", "number", "name"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The project it's on, or null"
                },
                "maintenance": {
                  "description": "The maintenance job or inspection blocking it, by name, or null",
                  "type": ["string", "null"]
                },
                "freeFrom": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it's back from the other project, or null if not known"
                }
              },
              "required": [
                "assetUUID",
                "assetId",
                "reason",
                "project",
                "maintenance",
                "freeFrom"
              ],
              "additionalProperties": false
            },
            "description": "Assets of the type that can't go on the line, and why. At most 500"
          },
          "busyCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many assets can't go on the line in all"
          }
        },
        "required": [
          "line",
          "start",
          "end",
          "free",
          "freeCount",
          "busy",
          "busyCount"
        ],
        "additionalProperties": false
      },
      "AvailabilityCheckOutput": {
        "type": "object",
        "properties": {
          "start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Start of the period checked, or null"
          },
          "end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "End of the period checked, or null"
          },
          "assetTypes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetTypeUUID": {
                  "type": "string",
                  "description": "UUID of the asset type"
                },
                "name": {
                  "type": "string",
                  "description": "Name of the asset type"
                },
                "total": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Stock of the asset type"
                },
                "booked": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "On confirmed projects over the period"
                },
                "held": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "On provisional projects over the period. Not taken away"
                },
                "blocked": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Blocked by maintenance or an overdue inspection"
                },
                "available": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Total less booked and blocked. Without a period, nothing is booked"
                }
              },
              "required": [
                "assetTypeUUID",
                "name",
                "total",
                "booked",
                "held",
                "blocked",
                "available"
              ],
              "additionalProperties": false
            },
            "description": "Each asset type found. Deleted ones are left out"
          }
        },
        "required": ["start", "end", "assetTypes"],
        "additionalProperties": false
      },
      "ClientPricingListOutput": {
        "type": "object",
        "properties": {
          "clientPricing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientPricing"
            },
            "description": "Client pricing on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of client pricing across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["clientPricing", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ClientPricingDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the client pricing that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "ClientPricingRemoveEntryOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the entry that was removed"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "ClientsSetPricingOutput": {
        "type": "object",
        "properties": {
          "clientUUID": {
            "type": "string",
            "description": "UUID of the client"
          },
          "clientPricingUUID": {
            "description": "UUID of its client pricing, or null",
            "type": ["string", "null"]
          }
        },
        "required": ["clientUUID", "clientPricingUUID"],
        "additionalProperties": false
      },
      "PricesPreviewOutput": {
        "type": "object",
        "properties": {
          "rate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The rate of one item after the client pricing, in the smallest currency unit, or null if it isn't for hire"
          },
          "catalogueRate": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The rate before the client pricing"
          },
          "rateSource": {
            "type": "string",
            "enum": [
              "TYPE",
              "ASSET",
              "CLIENT_PRICING_TYPE",
              "CLIENT_PRICING_CATEGORY",
              "CLIENT_PRICING"
            ],
            "description": "Where the rate came from: the `TYPE`, the `ASSET`'s own rate, the list's entry for the type (`CLIENT_PRICING_TYPE`) or a category (`CLIENT_PRICING_CATEGORY`), or the list's own percentage (`CLIENT_PRICING`)"
          },
          "priceStructure": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "UUID of the price structure"
              },
              "name": {
                "type": "string",
                "description": "Name of the price structure"
              },
              "unit": {
                "type": "string",
                "enum": ["HOUR", "DAY", "WEEK", "MONTH", "NONE"],
                "description": "What one unit is"
              }
            },
            "required": ["uuid", "name", "unit"],
            "additionalProperties": false,
            "description": "The price structure that applies"
          },
          "prices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "units": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The hire length asked for"
                },
                "factor": {
                  "type": "number",
                  "description": "The structure's multiplier of the rate"
                },
                "price": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The price of one item for that length"
                }
              },
              "required": ["units", "factor", "price"],
              "additionalProperties": false
            },
            "description": "One price per hire length asked for. Empty if not for hire"
          }
        },
        "required": [
          "rate",
          "catalogueRate",
          "rateSource",
          "priceStructure",
          "prices"
        ],
        "additionalProperties": false
      },
      "CustomFieldsListOutput": {
        "type": "object",
        "properties": {
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomField"
            },
            "description": "Live fields, in form order"
          }
        },
        "required": ["fields"],
        "additionalProperties": false
      },
      "CustomFieldsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted field"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "CommentsListOutput": {
        "type": "object",
        "properties": {
          "comments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Comment"
            },
            "description": "The comments on this page"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of comments across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["comments", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "CommentsPeopleOutput": {
        "type": "object",
        "properties": {
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommentPerson"
            },
            "description": "Members who can be mentioned or assigned, by name"
          }
        },
        "required": ["people"],
        "additionalProperties": false
      },
      "IconsListOutput": {
        "type": "object",
        "properties": {
          "icons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Icon"
            },
            "description": "The organisation's icons, by name"
          }
        },
        "required": ["icons"],
        "additionalProperties": false
      },
      "IconsDeleteOutput": {
        "type": "object",
        "properties": {
          "clearedCategories": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of asset categories that were using the icon, and now have none"
          }
        },
        "required": ["clearedCategories"],
        "additionalProperties": false
      },
      "InvitationsListOutput": {
        "type": "object",
        "properties": {
          "invitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invitation"
            },
            "description": "Invitations not yet accepted or revoked, newest first"
          }
        },
        "required": ["invitations"],
        "additionalProperties": false
      },
      "InvitationsRevokeOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the revoked invitation"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "MembersListOutput": {
        "type": "object",
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            },
            "description": "The organisation's members"
          }
        },
        "required": ["members"],
        "additionalProperties": false
      },
      "MembersMeOutput": {
        "type": "object",
        "properties": {
          "member": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Member"
              },
              {
                "type": "null"
              }
            ],
            "description": "The caller as a member of the organisation, with their name, email address, role and licence. Null for AdamRMS support acting through support access, who isn't a member"
          },
          "organisation": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "description": "The organisation's UUID"
              },
              "name": {
                "type": "string",
                "description": "The organisation's name"
              },
              "slug": {
                "type": "string",
                "description": "The organisation URL, as used in links to its pages"
              }
            },
            "required": ["uuid", "name", "slug"],
            "additionalProperties": false,
            "description": "The organisation the call is in"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every permission the caller's role gives them in the organisation, such as `ASSETS.CREATE`. Use it to check what they can do before trying"
          },
          "credential": {
            "type": "string",
            "enum": [
              "SESSION",
              "API_KEY",
              "OAUTH",
              "AGENT_GRANT",
              "CALENDAR_FEED",
              "APP_INSTALLATION"
            ],
            "description": "How the caller signed in: `SESSION` (the browser), `API_KEY`, `OAUTH` (an AI tool signed in through the browser), `AGENT_GRANT` (code AdamRMS AI wrote, approved by the member), `CALENDAR_FEED` or `APP_INSTALLATION` (an App's bot member)"
          }
        },
        "required": ["member", "organisation", "permissions", "credential"],
        "additionalProperties": false
      },
      "LicencesListOutput": {
        "type": "object",
        "properties": {
          "licences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Licence"
            },
            "description": "Every licence the organisation has, assigned or free"
          }
        },
        "required": ["licences"],
        "additionalProperties": false
      },
      "FilesListOutput": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganisationFile"
            },
            "description": "Files and links on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of files across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["files", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "FilesStartUploadOutput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "description": "Identifies this upload. Pass it to `files.finish-upload` once the bytes are sent"
          },
          "uploadUrl": {
            "type": "string",
            "description": "Path to PUT the file's bytes to, relative to the site. Anyone holding it can upload to it until the upload is finished or expires, so keep it private. For a multipart upload, PUT each part to it with `?partNumber=N` (1-based) and keep each response's `ETag`"
          },
          "multipart": {
            "type": "boolean",
            "description": "Whether the file must be sent in parts of `partSizeBytes` (the last part may be smaller)"
          },
          "partSizeBytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Size of each part, for a multipart upload"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the upload URL stops working"
          }
        },
        "required": [
          "uploadToken",
          "uploadUrl",
          "multipart",
          "partSizeBytes",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "RolesListOutput": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Role"
            },
            "description": "The organisation's roles: built-in ones first, then custom ones in the organisation's order"
          }
        },
        "required": ["roles"],
        "additionalProperties": false
      },
      "RolesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted role"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "WebhooksListOutput": {
        "type": "object",
        "properties": {
          "webhooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            },
            "description": "The organisation's webhooks"
          }
        },
        "required": ["webhooks"],
        "additionalProperties": false
      },
      "WebhooksCreateOutput": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          },
          "secret": {
            "type": "string",
            "description": "The signing secret, starting `whsec_`. Shown only now: keep it to check each event's `webhook-signature`"
          }
        },
        "required": ["webhook", "secret"],
        "additionalProperties": false
      },
      "WebhooksDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "The deleted webhook's UUID"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "WebhooksDeliveriesOutput": {
        "type": "object",
        "properties": {
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            },
            "description": "Events sent to the webhook in the last 30 days, newest first"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of deliveries across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["deliveries", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "JoinCodesListOutput": {
        "type": "object",
        "properties": {
          "joinCodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JoinCode"
            },
            "description": "The organisation's join codes"
          }
        },
        "required": ["joinCodes"],
        "additionalProperties": false
      },
      "JoinCodesDeleteOutput": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The deleted code"
          }
        },
        "required": ["code"],
        "additionalProperties": false
      },
      "EmailDomainsListOutput": {
        "type": "object",
        "properties": {
          "emailDomains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailDomain"
            },
            "description": "The organisation's email domains"
          }
        },
        "required": ["emailDomains"],
        "additionalProperties": false
      },
      "EmailDomainsDeleteOutput": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The removed domain"
          }
        },
        "required": ["domain"],
        "additionalProperties": false
      },
      "SingleSignOnDomainsRemoveOutput": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The removed domain"
          }
        },
        "required": ["domain"],
        "additionalProperties": false
      },
      "OrganisationUrlListOutput": {
        "type": "object",
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganisationUrl"
            },
            "description": "The current URL and every former one, newest first"
          }
        },
        "required": ["urls"],
        "additionalProperties": false
      },
      "OrganisationUrlChangeOutput": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "The organisation's URL slug now"
          },
          "previousSlug": {
            "description": "The slug it had before, which now redirects",
            "type": ["string", "null"]
          }
        },
        "required": ["slug", "previousSlug"],
        "additionalProperties": false
      },
      "AppsListOutput": {
        "type": "object",
        "properties": {
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/App"
            },
            "description": "Apps on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of Apps across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["apps", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "AppsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the App that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "AppsUninstallOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the installation that was removed"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "AppsRunsListOutput": {
        "type": "object",
        "properties": {
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppRunSummary"
            },
            "description": "Runs on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of runs across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["runs", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "AppsMarketplaceListOutput": {
        "type": "object",
        "properties": {
          "listings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppListing"
            },
            "description": "Listings on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of listings across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["listings", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "AppsUiAssetPanelRenderOutput": {
        "type": "object",
        "properties": {
          "panels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppUiPanel"
            },
            "description": "The panels of every running App the caller can see, by App name. Panels whose handler returned null are left out"
          }
        },
        "required": ["panels"],
        "additionalProperties": false
      },
      "AppsUiAssetPanelListOutput": {
        "type": "object",
        "properties": {
          "panels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "installationUUID": {
                  "type": "string",
                  "description": "UUID of the installation the panel comes from"
                },
                "appName": {
                  "type": "string",
                  "description": "Name of the App"
                },
                "title": {
                  "type": "string",
                  "description": "Heading of the panel"
                }
              },
              "required": ["installationUUID", "appName", "title"],
              "additionalProperties": false
            },
            "description": "The panels the caller can see, by App name"
          }
        },
        "required": ["panels"],
        "additionalProperties": false
      },
      "AppsUiAssetPanelActionOutput": {
        "type": "object",
        "properties": {
          "message": {
            "description": "What the App asked to tell the member, or null",
            "type": ["string", "null"]
          },
          "runUUID": {
            "description": "UUID of the action's run, or null when it called one of the App's functions",
            "type": ["string", "null"]
          },
          "panel": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppUiPanel"
              },
              {
                "type": "null"
              }
            ],
            "description": "The panel shown again after the action, or null if the App now shows nothing there"
          }
        },
        "required": ["message", "runUUID", "panel"],
        "additionalProperties": false
      },
      "LegacyImportStatusOutput": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean",
            "description": "Whether importing is set up on this server. When false, nothing else is returned"
          },
          "link": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "legacyInstanceId": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "The business's ID in the previous version"
                  },
                  "legacyInstanceName": {
                    "type": "string",
                    "description": "The business's name in the previous version"
                  },
                  "linkedAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                    "description": "When it was connected"
                  },
                  "movedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "When the organisation finished moving, after which no more imports run. Null until then"
                  }
                },
                "required": [
                  "legacyInstanceId",
                  "legacyInstanceName",
                  "linkedAt",
                  "movedAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The business this organisation imports from, or null if none is connected"
          },
          "running": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LegacyImportRun"
              },
              {
                "type": "null"
              }
            ],
            "description": "The run in progress, or null"
          },
          "last": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LegacyImportRun"
              },
              {
                "type": "null"
              }
            ],
            "description": "The most recent run that has ended, or null"
          },
          "preflight": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "entity": {
                      "type": "string",
                      "description": "The kind of record, e.g. `assets`"
                    },
                    "inLegacy": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Live records of this kind in the previous version"
                    },
                    "imported": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Records of this kind imported so far, and still here"
                    }
                  },
                  "required": ["entity", "inLegacy", "imported"],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Records to import, by kind. Null when not asked for, not connected, or the previous version couldn't be reached"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": ["ASSET_ALLOWANCE", "STORAGE_ALLOWANCE", "LICENCES"],
                  "description": "What is short"
                },
                "needed": {
                  "type": "number",
                  "description": "How many the import needs"
                },
                "available": {
                  "type": "number",
                  "description": "How many the organisation has room for"
                }
              },
              "required": ["code", "needed", "available"],
              "additionalProperties": false
            },
            "description": "What the organisation's plan or licences are too small for"
          }
        },
        "required": [
          "available",
          "link",
          "running",
          "last",
          "preflight",
          "warnings"
        ],
        "additionalProperties": false
      },
      "LegacyImportRunsListOutput": {
        "type": "object",
        "properties": {
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegacyImportRun"
            },
            "description": "Runs on this page, newest first unless asked otherwise"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of runs across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["runs", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "LegacyImportRunsGetOutput": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/LegacyImportRun"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entity": {
                  "type": "string",
                  "description": "The kind of record, e.g. `assets`"
                },
                "legacyId": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its ID in the previous version, or null for an issue with a whole kind of record"
                },
                "code": {
                  "type": "string",
                  "description": "What went wrong, e.g. `MISSING_PARENT` or `EMAIL_NOT_VERIFIED`"
                },
                "message": {
                  "type": "string",
                  "description": "What went wrong, in words"
                }
              },
              "required": ["entity", "legacyId", "code", "message"],
              "additionalProperties": false,
              "description": "A record a run couldn't import"
            },
            "description": "Records the run couldn't import, in the order it found them. At most 1,000"
          }
        },
        "required": ["run", "issues"],
        "additionalProperties": false
      },
      "LegacyImportDisconnectOutput": {
        "type": "object",
        "properties": {
          "legacyInstanceId": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The business that is no longer connected"
          }
        },
        "required": ["legacyInstanceId"],
        "additionalProperties": false
      },
      "LegacyImportFinishOutput": {
        "type": "object",
        "properties": {
          "movedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the organisation finished moving"
          },
          "url": {
            "type": "string",
            "description": "The organisation's address here, where the previous version now sends its members"
          },
          "emailed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many imported members were emailed to say it has moved"
          }
        },
        "required": ["movedAt", "url", "emailed"],
        "additionalProperties": false
      },
      "LocationBarcodesListOutput": {
        "type": "object",
        "properties": {
          "ownValue": {
            "type": "string",
            "description": "The value AdamRMS prints for the location (its UUID)"
          },
          "barcodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationBarcode"
            },
            "description": "Its other barcodes, oldest first"
          }
        },
        "required": ["ownValue", "barcodes"],
        "additionalProperties": false
      },
      "LocationBarcodesRemoveOutput": {
        "type": "object",
        "properties": {
          "removed": {
            "type": "boolean",
            "description": "Always true"
          }
        },
        "required": ["removed"],
        "additionalProperties": false
      },
      "BarcodesResolveOutput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": ["ASSET", "LOCATION", "NONE"],
            "description": "What the barcode belongs to"
          },
          "asset": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScannedAsset"
              },
              {
                "type": "null"
              }
            ],
            "description": "The asset, when kind is ASSET"
          },
          "location": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the location"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the location"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The location, when kind is LOCATION"
          },
          "locationPath": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the location"
                },
                "name": {
                  "type": "string",
                  "description": "Name of the location"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "The locations it is inside, outermost first, for a LOCATION"
          }
        },
        "required": ["kind", "asset", "location", "locationPath"],
        "additionalProperties": false
      },
      "ScanSessionsVerifyTargetOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the session"
          },
          "target": {
            "$ref": "#/components/schemas/ScanTarget"
          },
          "mode": {
            "type": "string",
            "enum": ["RECORD", "MOVE"],
            "description": "`RECORD` only records where assets were seen. `MOVE` also sets each asset's storage location (and takes it out of any case) or puts it in the case"
          },
          "includeSubLocations": {
            "type": "boolean",
            "description": "Stock checks only: assets stored in locations inside the target are expected too"
          },
          "targetVerified": {
            "type": "boolean",
            "description": "The target was proved by scanning its barcode, rather than picked from a list"
          },
          "filming": {
            "type": "boolean",
            "description": "Scans in this session are filmed, where the device can"
          },
          "photosRequired": {
            "type": "boolean",
            "description": "Every scan in this session needs a condition photo"
          },
          "inspectionTemplate": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the template"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the template"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Each asset scanned is inspected with this template, such as PAT testing a batch, or null"
          },
          "startedByUserUuid": {
            "description": "UUID of the member who started it",
            "type": ["string", "null"]
          },
          "scanCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many scans were recorded"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it started"
          },
          "endedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was ended, or null while it is open"
          },
          "verified": {
            "type": "boolean",
            "description": "The barcode belonged to the target"
          }
        },
        "required": [
          "uuid",
          "target",
          "mode",
          "includeSubLocations",
          "targetVerified",
          "filming",
          "photosRequired",
          "inspectionTemplate",
          "startedByUserUuid",
          "scanCount",
          "startedAt",
          "endedAt",
          "verified"
        ],
        "additionalProperties": false
      },
      "ScanSessionsListOutput": {
        "type": "object",
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanSession"
            },
            "description": "Sessions on this page"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of sessions across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["sessions", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ScansRecordOutput": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string",
            "enum": ["RECORDED", "ALREADY_SCANNED", "UNKNOWN", "LOCATION"],
            "description": "`RECORDED`; `ALREADY_SCANNED` (that unit is already in this session, so nothing was recorded); `UNKNOWN` (no asset or location has that barcode); or `LOCATION` (it is a location's barcode, so nothing was recorded: the scanner may switch target or verify it)"
          },
          "scan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Scan"
              },
              {
                "type": "null"
              }
            ],
            "description": "The scan, when RECORDED"
          },
          "asset": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScannedAsset"
              },
              {
                "type": "null"
              }
            ],
            "description": "The asset, when RECORDED or ALREADY_SCANNED"
          },
          "location": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "UUID of the location"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the location"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The location, when LOCATION"
          },
          "moveFailed": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["CASE_IS_SELF_OR_INSIDE", "TOO_DEEP"]
              },
              {
                "type": "null"
              }
            ],
            "description": "In a MOVE session, why the asset couldn't be put in the case. The sighting is still recorded"
          },
          "project": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "PREPPED",
                      "DISPATCHED",
                      "RETURNED",
                      "NOT_ON_PROJECT",
                      "UNAVAILABLE"
                    ],
                    "description": "`PREPPED`, `DISPATCHED` or `RETURNED` (the asset's allocation was updated); `NOT_ON_PROJECT` (it isn't allocated, and no line of its type needs one); `UNAVAILABLE` (a line needs one, but the asset is booked elsewhere or blocked by maintenance)"
                  },
                  "lineUUID": {
                    "description": "The line it's allocated to, or null",
                    "type": ["string", "null"]
                  },
                  "lineDescription": {
                    "description": "What that line is, or null",
                    "type": ["string", "null"]
                  },
                  "projectUUID": {
                    "description": "The project or sub-project the line is on, or null",
                    "type": ["string", "null"]
                  },
                  "allocated": {
                    "type": "boolean",
                    "description": "It wasn't allocated before, and this scan allocated it"
                  },
                  "contents": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "How many assets packed in it were updated with it"
                  }
                },
                "required": [
                  "outcome",
                  "lineUUID",
                  "lineDescription",
                  "projectUUID",
                  "allocated",
                  "contents"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "In a PROJECT session and when RECORDED, what the scan did on the project"
          }
        },
        "required": [
          "outcome",
          "scan",
          "asset",
          "location",
          "moveFailed",
          "project"
        ],
        "additionalProperties": false
      },
      "ScansListOutput": {
        "type": "object",
        "properties": {
          "scans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scan"
            },
            "description": "Scans on this page"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of scans across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["scans", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ScansLatestOutput": {
        "type": "object",
        "properties": {
          "scan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Scan"
              },
              {
                "type": "null"
              }
            ],
            "description": "The latest scan made with a camera or scanner (not typed), or null if it has never been scanned"
          }
        },
        "required": ["scan"],
        "additionalProperties": false
      },
      "ScanMediaStartUploadOutput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "description": "Pass to `scan-media.finish-upload` once the bytes are sent"
          },
          "uploadUrl": {
            "type": "string",
            "description": "Where to PUT the bytes, with the declared Content-Type"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the upload expires"
          }
        },
        "required": ["uploadToken", "uploadUrl", "expiresAt"],
        "additionalProperties": false
      },
      "ScanPhotosRemoveOutput": {
        "type": "object",
        "properties": {
          "removed": {
            "type": "boolean",
            "description": "Always true"
          }
        },
        "required": ["removed"],
        "additionalProperties": false
      },
      "StockChecksResultOutput": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/ScanSession"
          },
          "found": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "asset": {
                  "$ref": "#/components/schemas/ScannedAsset"
                },
                "expectedQuantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many should be there (the lot's size, or 1)"
                },
                "foundQuantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many were scanned (counting assets in scanned cases)"
                }
              },
              "required": ["asset", "expectedQuantity", "foundQuantity"],
              "additionalProperties": false
            },
            "description": "Expected assets that were scanned, in full or in part"
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "asset": {
                  "$ref": "#/components/schemas/ScannedAsset"
                },
                "expectedQuantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many should be there (the lot's size, or 1)"
                },
                "foundQuantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many were scanned (counting assets in scanned cases)"
                }
              },
              "required": ["asset", "expectedQuantity", "foundQuantity"],
              "additionalProperties": false
            },
            "description": "Expected assets that weren't scanned"
          },
          "extra": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "asset": {
                  "$ref": "#/components/schemas/ScannedAsset"
                },
                "expectedQuantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many should be there (the lot's size, or 1)"
                },
                "foundQuantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many were scanned (counting assets in scanned cases)"
                }
              },
              "required": ["asset", "expectedQuantity", "foundQuantity"],
              "additionalProperties": false
            },
            "description": "Assets scanned that aren't stored here"
          }
        },
        "required": ["session", "found", "missing", "extra"],
        "additionalProperties": false
      },
      "ScanPresetsListOutput": {
        "type": "object",
        "properties": {
          "presets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanPreset"
            },
            "description": "Every preset, by name"
          }
        },
        "required": ["presets"],
        "additionalProperties": false
      },
      "ScanPresetsDeleteOutput": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean",
            "description": "Always true"
          }
        },
        "required": ["deleted"],
        "additionalProperties": false
      },
      "MaintenanceStatusesListOutput": {
        "type": "object",
        "properties": {
          "statuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MaintenanceStatus"
            },
            "description": "Statuses on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of statuses across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["statuses", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "MaintenanceStatusesDeleteOutput": {
        "type": "object",
        "properties": {
          "movedJobs": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many jobs moved to the replacement"
          }
        },
        "required": ["movedJobs"],
        "additionalProperties": false
      },
      "MaintenancePrioritiesListOutput": {
        "type": "object",
        "properties": {
          "priorities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MaintenancePriority"
            },
            "description": "Priorities on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of priorities across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["priorities", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "MaintenanceJobsListOutput": {
        "type": "object",
        "properties": {
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MaintenanceJob"
            },
            "description": "Jobs on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of jobs across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["jobs", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "MaintenanceJobsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted job"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "MaintenanceJobsChargeableProjectsOutput": {
        "type": "object",
        "properties": {
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the project"
                },
                "number": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The project's number"
                },
                "name": {
                  "type": "string",
                  "description": "The project's name"
                }
              },
              "required": ["uuid", "number", "name"],
              "additionalProperties": false
            },
            "description": "Projects the job's assets have been on, most recent first, at most 20"
          }
        },
        "required": ["projects"],
        "additionalProperties": false
      },
      "MaintenanceAssetStateOutput": {
        "type": "object",
        "properties": {
          "blocked": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many of the asset can't be booked because of open jobs or overdue inspections: 0, or up to its quantity"
          },
          "flagged": {
            "type": "boolean",
            "description": "An open job or an overdue inspection shows a warning on the asset"
          },
          "jobs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the job"
                },
                "number": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The job's number"
                },
                "title": {
                  "type": "string",
                  "description": "The job's title"
                },
                "status": {
                  "type": "string",
                  "description": "Name of the job's status"
                },
                "priority": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Display name, for example 'Urgent'"
                    },
                    "colour": {
                      "type": "string",
                      "enum": ["red", "yellow", "green", "blue", "gray"],
                      "description": "Colour of the priority's badge"
                    }
                  },
                  "required": ["name", "colour"],
                  "additionalProperties": false,
                  "description": "The job's priority"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How many of the asset the job covers"
                },
                "flags": {
                  "type": "boolean",
                  "description": "The job flags the asset (and it isn't released)"
                },
                "blocks": {
                  "type": "boolean",
                  "description": "The job blocks the asset (and it isn't released)"
                }
              },
              "required": [
                "uuid",
                "number",
                "title",
                "status",
                "priority",
                "quantity",
                "flags",
                "blocks"
              ],
              "additionalProperties": false
            },
            "description": "Open jobs that cover the asset, most urgent first"
          },
          "inspections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the inspection template"
                },
                "name": {
                  "type": "string",
                  "description": "Name of the inspection, such as 'PAT'"
                },
                "dueAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When it was due"
                },
                "blocks": {
                  "type": "boolean",
                  "description": "Being overdue blocks the asset, rather than flagging it"
                }
              },
              "required": ["uuid", "name", "dueAt", "blocks"],
              "additionalProperties": false
            },
            "description": "Inspections the asset is overdue, or failed and is due again"
          }
        },
        "required": ["blocked", "flagged", "jobs", "inspections"],
        "additionalProperties": false
      },
      "ProjectStatusesListOutput": {
        "type": "object",
        "properties": {
          "statuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectStatus"
            },
            "description": "Statuses on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of statuses across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["statuses", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ProjectStatusesDeleteOutput": {
        "type": "object",
        "properties": {
          "movedProjects": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many projects moved to the replacement"
          }
        },
        "required": ["movedProjects"],
        "additionalProperties": false
      },
      "ProjectTypesListOutput": {
        "type": "object",
        "properties": {
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectType"
            },
            "description": "Types on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of types across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["types", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ProjectsListOutput": {
        "type": "object",
        "properties": {
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Project"
            },
            "description": "Projects on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of projects across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["projects", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ProjectsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the projects moved to trash: the project and its sub-projects"
          }
        },
        "required": ["uuids"],
        "additionalProperties": false
      },
      "ProjectNotesListOutput": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectNote"
            },
            "description": "Notes on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of notes across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["notes", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ProjectsHistoryOutput": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "occurredAt": {
                  "type": "string",
                  "description": "When it happened (ISO 8601)"
                },
                "actorName": {
                  "description": "Who did it, or null when AdamRMS did it itself",
                  "type": ["string", "null"]
                },
                "action": {
                  "type": "string",
                  "description": "What kind of change, such as organisation.project_line.added"
                },
                "summary": {
                  "type": "string",
                  "description": "What changed, in a sentence"
                }
              },
              "required": ["occurredAt", "actorName", "action", "summary"],
              "additionalProperties": false
            },
            "description": "Changes to the project and to its lines, crew, notes, quotes, invoices and payments, newest first. Only those the caller may see"
          },
          "nextBefore": {
            "description": "Pass as before for the next page, or null when there are no more in the last 90 days",
            "type": ["string", "null"]
          }
        },
        "required": ["events", "nextBefore"],
        "additionalProperties": false
      },
      "ProjectNotesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted note"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "ProjectFoldersListOutput": {
        "type": "object",
        "properties": {
          "folders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectFolder"
            },
            "description": "Every folder, sorted by name. Build the tree from each one's `parentUUID`"
          }
        },
        "required": ["folders"],
        "additionalProperties": false
      },
      "ProjectFoldersDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted folder"
          },
          "movedProjects": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many projects moved up to the folder it was in"
          }
        },
        "required": ["uuid", "movedProjects"],
        "additionalProperties": false
      },
      "InspectionTemplatesListOutput": {
        "type": "object",
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionTemplate"
            },
            "description": "Templates on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of templates across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["templates", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "InspectionTemplatesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted template"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "InspectionsListOutput": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionResult"
            },
            "description": "Results on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of results across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["results", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "InspectionsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the deleted result"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "InspectionsAssetStatusOutput": {
        "type": "object",
        "properties": {
          "inspections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "template": {
                  "type": "object",
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "UUID of the template"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the template"
                    },
                    "whenOverdue": {
                      "type": "string",
                      "enum": ["BLOCK", "FLAG"],
                      "description": "What happens when the asset is overdue"
                    }
                  },
                  "required": ["uuid", "name", "whenOverdue"],
                  "additionalProperties": false,
                  "description": "The inspection"
                },
                "intervalValue": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How often the asset is due: its own interval, or the template's"
                },
                "intervalUnit": {
                  "type": "string",
                  "enum": ["DAYS", "WEEKS", "MONTHS", "YEARS"],
                  "description": "Unit of `intervalValue`"
                },
                "overridden": {
                  "type": "boolean",
                  "description": "The asset has its own interval for this template"
                },
                "lastResult": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the result"
                        },
                        "passed": {
                          "type": "boolean",
                          "description": "It passed"
                        },
                        "testedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                          "description": "When it was tested"
                        }
                      },
                      "required": ["uuid", "passed", "testedAt"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The latest result, or null if never inspected"
                },
                "dueAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When it's next due"
                },
                "overdue": {
                  "type": "boolean",
                  "description": "It's due now or was due before now"
                },
                "returnCheck": {
                  "type": "boolean",
                  "description": "It's due because it came back from a project since it was last inspected, and the template checks each asset on return"
                }
              },
              "required": [
                "template",
                "intervalValue",
                "intervalUnit",
                "overridden",
                "lastResult",
                "dueAt",
                "overdue",
                "returnCheck"
              ],
              "additionalProperties": false
            },
            "description": "Each inspection that applies to the asset"
          },
          "excluded": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the template"
                },
                "name": {
                  "type": "string",
                  "description": "Name of the template"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "Templates its type has that this asset is left out of"
          }
        },
        "required": ["inspections", "excluded"],
        "additionalProperties": false
      },
      "InspectionsDueOutput": {
        "type": "object",
        "properties": {
          "due": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "template": {
                  "type": "object",
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "UUID of the template"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the template"
                    },
                    "whenOverdue": {
                      "type": "string",
                      "enum": ["BLOCK", "FLAG"],
                      "description": "What happens when the asset is overdue"
                    }
                  },
                  "required": ["uuid", "name", "whenOverdue"],
                  "additionalProperties": false,
                  "description": "The inspection"
                },
                "intervalValue": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "How often the asset is due: its own interval, or the template's"
                },
                "intervalUnit": {
                  "type": "string",
                  "enum": ["DAYS", "WEEKS", "MONTHS", "YEARS"],
                  "description": "Unit of `intervalValue`"
                },
                "overridden": {
                  "type": "boolean",
                  "description": "The asset has its own interval for this template"
                },
                "lastResult": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "UUID of the result"
                        },
                        "passed": {
                          "type": "boolean",
                          "description": "It passed"
                        },
                        "testedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                          "description": "When it was tested"
                        }
                      },
                      "required": ["uuid", "passed", "testedAt"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The latest result, or null if never inspected"
                },
                "dueAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When it's next due"
                },
                "overdue": {
                  "type": "boolean",
                  "description": "It's due now or was due before now"
                },
                "returnCheck": {
                  "type": "boolean",
                  "description": "It's due because it came back from a project since it was last inspected, and the template checks each asset on return"
                },
                "asset": {
                  "type": "object",
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "UUID of the asset"
                    },
                    "primaryID": {
                      "description": "The asset's primary asset ID",
                      "type": ["string", "null"]
                    },
                    "assetTypeName": {
                      "type": "string",
                      "description": "Name of the asset's type"
                    }
                  },
                  "required": ["uuid", "primaryID", "assetTypeName"],
                  "additionalProperties": false,
                  "description": "The asset"
                }
              },
              "required": [
                "template",
                "intervalValue",
                "intervalUnit",
                "overridden",
                "lastResult",
                "dueAt",
                "overdue",
                "returnCheck",
                "asset"
              ],
              "additionalProperties": false
            },
            "description": "Assets due, soonest first"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of assets due across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["due", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "InspectionsReturnChecksOutput": {
        "type": "object",
        "properties": {
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetUUID": {
                  "type": "string",
                  "description": "UUID of the asset"
                },
                "template": {
                  "type": "object",
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "UUID of the template"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the template"
                    }
                  },
                  "required": ["uuid", "name"],
                  "additionalProperties": false,
                  "description": "The inspection it's due"
                },
                "dueAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When it came back, so when the check fell due"
                }
              },
              "required": ["assetUUID", "template", "dueAt"],
              "additionalProperties": false
            },
            "description": "Each asset on the project that's back and due an inspection that checks on return"
          }
        },
        "required": ["checks"],
        "additionalProperties": false
      },
      "DocumentTemplatesListOutput": {
        "type": "object",
        "properties": {
          "documentTemplates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentTemplate"
            },
            "description": "Templates on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of document templates across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": [
          "documentTemplates",
          "total",
          "nextCursor",
          "previousCursor"
        ],
        "additionalProperties": false
      },
      "DocumentTemplatesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the template that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "DocumentsPreviewOutput": {
        "type": "object",
        "properties": {
          "html": {
            "type": "string",
            "description": "The whole page as HTML, ready for a sandboxed frame. The PDF is made from exactly this"
          },
          "paperSize": {
            "type": "string",
            "enum": ["A4", "LETTER"],
            "description": "Paper size: `A4` (210 × 297 mm) or `LETTER` (8.5 × 11 in)"
          }
        },
        "required": ["html", "paperSize"],
        "additionalProperties": false
      },
      "DocumentsListOutput": {
        "type": "object",
        "properties": {
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GeneratedDocument"
            },
            "description": "Documents made for the record, newest first, not counting deleted ones"
          }
        },
        "required": ["documents"],
        "additionalProperties": false
      },
      "DocumentsListForProjectOutput": {
        "type": "object",
        "properties": {
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectDocument"
            },
            "description": "Documents kept on the project and its sub-projects, newest first, not counting deleted ones. At most 500"
          }
        },
        "required": ["documents"],
        "additionalProperties": false
      },
      "DocumentsEmailOutput": {
        "type": "object",
        "properties": {
          "fileUUID": {
            "type": "string",
            "description": "UUID of the document that was sent"
          },
          "emailedTo": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "contactUUID": {
                  "type": "string",
                  "description": "UUID of the client contact"
                },
                "name": {
                  "type": "string",
                  "description": "The contact's name"
                },
                "email": {
                  "type": "string",
                  "description": "The address it was sent to"
                }
              },
              "required": ["contactUUID", "name", "email"],
              "additionalProperties": false
            },
            "description": "Who it was sent to"
          },
          "emailedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was sent"
          }
        },
        "required": ["fileUUID", "emailedTo", "emailedAt"],
        "additionalProperties": false
      },
      "CertificationTypesListOutput": {
        "type": "object",
        "properties": {
          "certificationTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CertificationType"
            },
            "description": "Certification types on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of certification types across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": [
          "certificationTypes",
          "total",
          "nextCursor",
          "previousCursor"
        ],
        "additionalProperties": false
      },
      "CertificationTypesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the certification type deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "MemberCertificationsListOutput": {
        "type": "object",
        "properties": {
          "certifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberCertification"
            },
            "description": "Certifications on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of certifications across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["certifications", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "MemberCertificationsRevokeAllOutput": {
        "type": "object",
        "properties": {
          "revoked": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many certifications were revoked"
          }
        },
        "required": ["revoked"],
        "additionalProperties": false
      },
      "MemberCertificationsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the certification deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "MemberCertificationsCheckOutput": {
        "type": "object",
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "memberUUID": {
                  "type": "string",
                  "description": "UUID of the member"
                },
                "ok": {
                  "type": "boolean",
                  "description": "Whether they hold every type, valid on the day"
                },
                "types": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "typeUUID": {
                        "type": "string",
                        "description": "UUID of the certification type"
                      },
                      "result": {
                        "type": "string",
                        "enum": ["VALID", "EXPIRED", "UNVERIFIED", "MISSING"],
                        "description": "VALID: verified and valid on the day. EXPIRED: they hold one, but it expires before the day. UNVERIFIED: they added one that hasn't been verified. MISSING: they hold none"
                      },
                      "certificationUUID": {
                        "description": "The certification the result is about, or null for MISSING",
                        "type": ["string", "null"]
                      },
                      "expiresOn": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Its expiry day, or null"
                      }
                    },
                    "required": [
                      "typeUUID",
                      "result",
                      "certificationUUID",
                      "expiresOn"
                    ],
                    "additionalProperties": false
                  },
                  "description": "One result per type asked about, in the same order"
                }
              },
              "required": ["memberUUID", "ok", "types"],
              "additionalProperties": false
            },
            "description": "One entry per member asked about, in the same order"
          }
        },
        "required": ["members"],
        "additionalProperties": false
      },
      "MemberCertificationsStartEvidenceUploadOutput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "description": "Pass to finish-evidence-upload"
          },
          "uploadUrl": {
            "type": "string",
            "description": "Private URL to PUT the file's bytes to"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the URL stops working"
          }
        },
        "required": ["uploadToken", "uploadUrl", "expiresAt"],
        "additionalProperties": false
      },
      "TrainingModulesListOutput": {
        "type": "object",
        "properties": {
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrainingModule"
            },
            "description": "Modules on this page that the caller may see"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of training modules across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["modules", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "TrainingModulesGetOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier of the module"
          },
          "name": {
            "type": "string",
            "description": "What it is called"
          },
          "description": {
            "description": "What it is about, or null",
            "type": ["string", "null"]
          },
          "learningObjectives": {
            "description": "What members will be able to do once they finish, in Markdown",
            "type": ["string", "null"]
          },
          "icon": {
            "description": "Icon reference: `tabler:<name>` or `custom:<uuid>`",
            "type": ["string", "null"]
          },
          "type": {
            "type": "string",
            "enum": ["ONLINE", "HYBRID", "IN_PERSON"],
            "description": "ONLINE: members work through the steps, and finishing them awards the certification. HYBRID: members work through the steps, then someone signs them off. IN_PERSON: there are no steps to finish; someone signs members off after training them"
          },
          "published": {
            "type": "boolean",
            "description": "Whether members can see it. Drafts are only seen by editors"
          },
          "certificationType": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "validityMonths": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": ["uuid", "name", "validityMonths"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The certification it awards, or null"
          },
          "visibleToRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["uuid", "name"],
              "additionalProperties": false
            },
            "description": "Roles that may see it. Empty for every member"
          },
          "stepCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Number of published steps"
          },
          "estimatedMinutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total estimated minutes of its published steps"
          },
          "author": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": ["uuid", "name"],
                "additionalProperties": false,
                "description": "A member of the organisation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who created it, or null"
          },
          "myProgress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "startedAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "updatedAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "completedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "completedSteps": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Published steps the caller has done"
                  }
                },
                "required": [
                  "startedAt",
                  "updatedAt",
                  "completedAt",
                  "completedSteps"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "How far the caller has got, or null if they haven't started"
          },
          "myCertification": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "VALID",
                      "EXPIRING",
                      "EXPIRED",
                      "UNVERIFIED",
                      "REVOKED"
                    ]
                  },
                  "expiresOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": ["uuid", "status", "expiresOn"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The caller's best certification of the type this module awards, or null"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrainingStep"
            },
            "description": "Its steps, in order. Unpublished ones only for editors"
          }
        },
        "required": [
          "uuid",
          "name",
          "description",
          "learningObjectives",
          "icon",
          "type",
          "published",
          "certificationType",
          "visibleToRoles",
          "stepCount",
          "estimatedMinutes",
          "author",
          "myProgress",
          "myCertification",
          "createdAt",
          "updatedAt",
          "steps"
        ],
        "additionalProperties": false
      },
      "TrainingModulesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the module deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "TrainingModulesProgressOutput": {
        "type": "object",
        "properties": {
          "stepCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Published steps in the module"
          },
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "member": {
                  "type": "object",
                  "properties": {
                    "uuid": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": ["uuid", "name"],
                  "additionalProperties": false,
                  "description": "Who"
                },
                "startedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When they started"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When they last did a step"
                },
                "completedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When they finished every step, or null"
                },
                "completedSteps": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Published steps they have done"
                },
                "certification": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "VALID",
                            "EXPIRING",
                            "EXPIRED",
                            "UNVERIFIED",
                            "REVOKED"
                          ]
                        },
                        "expiresOn": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": ["uuid", "status", "expiresOn"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Their best certification of the type the module awards, or null"
                },
                "readyForSignOff": {
                  "type": "boolean",
                  "description": "HYBRID modules: finished, and not yet holding the certification"
                }
              },
              "required": [
                "member",
                "startedAt",
                "updatedAt",
                "completedAt",
                "completedSteps",
                "certification",
                "readyForSignOff"
              ],
              "additionalProperties": false
            },
            "description": "Members who have started the module, on this page"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of members across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": [
          "stepCount",
          "members",
          "total",
          "nextCursor",
          "previousCursor"
        ],
        "additionalProperties": false
      },
      "TrainingStepsCompleteOutput": {
        "type": "object",
        "properties": {
          "completedSteps": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Published steps the caller has done"
          },
          "stepCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Published steps in the module"
          },
          "completedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the caller finished every step, or null"
          },
          "awarded": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MemberCertification"
              },
              {
                "type": "null"
              }
            ],
            "description": "The certification just awarded for finishing an ONLINE module, or null"
          },
          "readyForSignOff": {
            "type": "boolean",
            "description": "Whether the caller now waits to be signed off on a HYBRID module"
          }
        },
        "required": [
          "completedSteps",
          "stepCount",
          "completedAt",
          "awarded",
          "readyForSignOff"
        ],
        "additionalProperties": false
      },
      "ClientFinanceListOutput": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code"
          },
          "clients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientFinance"
            },
            "description": "One entry for each client asked for that exists, in the order asked for"
          }
        },
        "required": ["currency", "clients"],
        "additionalProperties": false
      },
      "PaymentMethodsListOutput": {
        "type": "object",
        "properties": {
          "paymentMethods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentMethod"
            },
            "description": "Payment methods on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of payment methods across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["paymentMethods", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "PaymentMethodsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the payment method that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "PaymentsListOutput": {
        "type": "object",
        "properties": {
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            },
            "description": "Payments on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of payments across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code of the amounts"
          }
        },
        "required": [
          "payments",
          "total",
          "nextCursor",
          "previousCursor",
          "currency"
        ],
        "additionalProperties": false
      },
      "PaymentsGetOutput": {
        "type": "object",
        "properties": {
          "payment": {
            "description": "The payment",
            "$ref": "#/components/schemas/Payment"
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code of the amount"
          }
        },
        "required": ["payment", "currency"],
        "additionalProperties": false
      },
      "PaymentsRetainDepositOutput": {
        "type": "object",
        "properties": {
          "retained": {
            "description": "The DEPOSIT_RETAINED entry",
            "$ref": "#/components/schemas/Payment"
          },
          "payment": {
            "description": "The PAYMENT for the charge",
            "$ref": "#/components/schemas/Payment"
          },
          "chargeLineUUID": {
            "type": "string",
            "description": "UUID of the charge line it became"
          }
        },
        "required": ["retained", "payment", "chargeLineUUID"],
        "additionalProperties": false
      },
      "PaymentsDeleteOutput": {
        "type": "object",
        "properties": {
          "uuids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "UUIDs of the payments that were deleted"
          }
        },
        "required": ["uuids"],
        "additionalProperties": false
      },
      "InvoicesListOutput": {
        "type": "object",
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invoice"
            },
            "description": "Invoices on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of invoices across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code of the amounts"
          }
        },
        "required": [
          "invoices",
          "total",
          "nextCursor",
          "previousCursor",
          "currency"
        ],
        "additionalProperties": false
      },
      "InvoicesDeleteDraftOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the draft that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "QuotesListOutput": {
        "type": "object",
        "properties": {
          "quotes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Quote"
            },
            "description": "Quotes on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of quotes across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["quotes", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "QuotesShareOutput": {
        "type": "object",
        "properties": {
          "shareKey": {
            "type": "string",
            "description": "The secret in the quote's link. The link is /{lang}/quote/{organisation URL}/{shareKey}. Anyone with it can see the quote and accept or decline it until it expires, is answered or a newer version is issued"
          }
        },
        "required": ["shareKey"],
        "additionalProperties": false
      },
      "QuotesRevokeLinkOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the quote whose link no longer works"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "ProjectCrewListOutput": {
        "type": "object",
        "properties": {
          "crew": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectCrewMember"
            },
            "description": "The project's crew, in the project's order"
          }
        },
        "required": ["crew"],
        "additionalProperties": false
      },
      "ProjectCrewListForMemberOutput": {
        "type": "object",
        "properties": {
          "crew": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectCrewMember"
            },
            "description": "The member's places on projects' crews, newest first"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of crew places across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["crew", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "ProjectCrewRemoveOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the place that was removed"
          },
          "lineKept": {
            "type": "boolean",
            "description": "Whether the place's priced line stayed on the project: an issued invoice charges for it, or the caller can't change the project's lines"
          }
        },
        "required": ["uuid", "lineKept"],
        "additionalProperties": false
      },
      "ProjectCrewEmailsOutput": {
        "type": "object",
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "UUID of the member"
                },
                "name": {
                  "type": "string",
                  "description": "The member's name"
                },
                "email": {
                  "type": "string",
                  "description": "The member's email address"
                }
              },
              "required": ["uuid", "name", "email"],
              "additionalProperties": false
            },
            "description": "Crew who are members, once each"
          },
          "namedPeople": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Crew who aren't members and have no email address in AdamRMS"
          },
          "namedPeopleWithEmail": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Their name"
                },
                "email": {
                  "type": "string",
                  "description": "The email address given for them"
                }
              },
              "required": ["name", "email"],
              "additionalProperties": false
            },
            "description": "Crew who aren't members, with the email address given for them"
          }
        },
        "required": ["members", "namedPeople", "namedPeopleWithEmail"],
        "additionalProperties": false
      },
      "CrewVacanciesListOutput": {
        "type": "object",
        "properties": {
          "vacancies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrewVacancy"
            },
            "description": "The project's vacancies, oldest first"
          }
        },
        "required": ["vacancies"],
        "additionalProperties": false
      },
      "CrewVacanciesOpenOutput": {
        "type": "object",
        "properties": {
          "vacancies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrewVacancy"
            },
            "description": "Vacancies on this page, in the order asked for"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of vacancies across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["vacancies", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "CrewVacanciesDeleteOutput": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "UUID of the vacancy that was deleted"
          }
        },
        "required": ["uuid"],
        "additionalProperties": false
      },
      "CrewApplicationsListOutput": {
        "type": "object",
        "properties": {
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrewApplication"
            },
            "description": "The vacancy's applications, oldest first"
          }
        },
        "required": ["applications"],
        "additionalProperties": false
      },
      "CrewApplicationsMineOutput": {
        "type": "object",
        "properties": {
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrewApplication"
            },
            "description": "The caller's applications on this page, newest first"
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Total number of applications across all pages"
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page. Null on the last page",
            "type": ["string", "null"]
          },
          "previousCursor": {
            "description": "Pass as `cursor` for the previous page. Null on the first page",
            "type": ["string", "null"]
          }
        },
        "required": ["applications", "total", "nextCursor", "previousCursor"],
        "additionalProperties": false
      },
      "CrewApplicationsStartFileUploadOutput": {
        "type": "object",
        "properties": {
          "uploadToken": {
            "type": "string",
            "description": "Pass to finish-file-upload"
          },
          "uploadUrl": {
            "type": "string",
            "description": "Where to PUT the file's bytes"
          },
          "expiresAt": {
            "type": "string",
            "description": "When the upload link stops working"
          }
        },
        "required": ["uploadToken", "uploadUrl", "expiresAt"],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable, machine-readable error code"
              },
              "message": {
                "type": "string",
                "description": "Human-readable, in English"
              },
              "issues": {
                "type": "array",
                "description": "Present for INVALID_INPUT: what is wrong with each field",
                "items": {
                  "type": "object",
                  "required": ["path", "message"],
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
